A long time ago in a galaxy, far, far away, there were N spheres with various radii. Spheres were mirrors, that is, they had reflective surfaces ...
You are standing at the origin of the galaxy (0, 0, 0), and emit a laser ray to the direction (u, v, w)
When the laser ray from I
IQN =
NQR

After it is reflected several times, finally it goes beyond our observation. Your mission is to write a program that identifies the last reflection point.
The input consists of multiple datasets, each in the following format.
| N |
|||
| u |
v |
w |
|
| x1 |
y1 |
z1 |
r1 |
| xN |
yN |
zN |
rN |
The first line of a dataset contains a positive integer N
Each of the following N
N, u, v, w, xi, yi, zi
The ray is known to be reflected by the sphere surfaces at least once, and at most five times. You can assume that the angle between the ray and the line connecting the sphere center and the reflection point, which is known as the angle of reflection (i.e.
The last dataset is followed by a line containing a single zero.
For each dataset in the input, you should print the x -