351. A Mission for a Scout

Time limit per test: 0.25 second(s)
Memory limit: 65536 kilobytes
input: standard
output: standard



The scout Sidorov is facing a delicate situation: he has to get from A to B. The embarrassment of the situation apparently lies in the news that the scout received lately. It appears that a bomb has been detonated at the neighborhood recently, and the explosion caused a circle crater. Fortunately, Sidorov has an antigravitator to fly over the craters, but the fuel in the tank is hardly enough for the distance D. Sidorov wrote out all the necessary data he had and sent it to you by secret post. He is looking forward to hearing from you, for nobody else can calculate the length of the shortest route from A to B, taking into consideration the craters and the fuel left. He also would like to get the route itself. Clearly, the route will consist only of segments and arcs of the circle formed by the crater.

Input
The first line describes four numbers XA, YA, XB, YB — coordinates of A and B accordingly. The second line describes three numbers XC, YC, RC — coordinates of the center and the radius of the crater. The third line describes D — the distance the antigravitator can fly over the crater. All coordinates in the input file are integers from 0 to 10\,000. RC and D are integer numbers from 1 to 10\,000. A doesn't coincide with B and both points are outside the crater.

Output
Write the number of the parts T of the desired route to the first line of the output file. After that write the description of route parts one per line. For each part of the route print character "S" (for segment) or "A" (for arc) followed by the coordinates of their endpoints. Coordinates should be written with 8 digits after decimal point. T should not exceed 100. The first point in the route should be point A, the last point — B, and the second endpoint of each part should coincide with the first endpoint of the next part in the route.
Example(s)
sample input
sample output
1 1 101 1
50 1 40
80
1
S 1.000000000 1.000000000 101.000000000 1.000000000

sample input
sample output
1 1 101 1
50 1 40
1
4
S 1.00000000 1.00000000 17.34693878 24.10362726
S 17.34693878 24.10362726 17.93468841 24.91267013
A 17.93468841 24.91267013 81.37254902 25.81457572
S 81.37254902 25.81457572 101.00000000 1.00000000 


Online Contester Team © 2002 - 2010. All rights reserved.