There’s a cuboid (a*b*c) with a magic ball(radius R) which can move freely in it placed in the 3-Dspace as described in the picture below. If the ball’s initial velocity is (Vx,Vy,Vz) per second and its center’s initial position is (Px,Py,Pz), there comes the question that where it will be in T seconds later?
We guarantee that the WHOLE ball is always IN the cuboid, and collisions between the ball and the inner faces of this cuboid satisfy the Conservation of Kinetic Energy(it means there isn’t any kinetic energy loss in the collisions) and the Law of Reflection, moreover, there’s no friction in the movement, too.
Input
The input starts with a line containing a single number N, the number of test cases, then N test cases follows.
Each test case consists of three lines:
The first line contains three numbers a, b, c. (0.0<a,b,c<=1.0*10^4)
The second line contains four numbers R,Px,Py,Pz.
(0.0 <R,Px,Py,Pz<=1.0*10^4)
The third line contains four numbers Vx, Vy, Vz, T.
(-1.0*10^4<=Vx,Vy,Vz<=1.0*10^4, 0.0 <=T<=1.0*10^9)
There will be a blank line after each test case.
Output
For each test case just output one line, starting with “Case #X: ”and followed by three numbers Fx, Fy, Fz, rounded to one decimal places and separated by a single space, which represent the ball’s center’s final position after T seconds.(Please note that there’s a space after ‘:’, and X means the No. of that test case.) Please see samples for more details.