In a xyz-space, a box lies on the coordinate axes, with O=(0,0,0) and P=(A,B,C), referring to the figure below:
A ball is placed inside the box. At t=0, its initial position is (x0, y0, z0) and its initial velocity is (u0, v0, w0), where u0, v0, w0 is the initial velocity component relative to x-axis, y-axis, and z-axis. The ball always moves with constant velocity except that it bounces when colliding the walls of the box. The collision obeys law of reflection: After collision with a wall, the velocity component normal to the wall is negated. For example, if the ball with velocity (u, v, w) collides the wall on plane z=0, after collision the ball bounces and has velocity (u, v, -w).

Please calculate the position of the ball at time N.
Explanation on sample io
On plane z=0, the movement of the ball is illustrated in the figure below:

Each input contains multiple test cases. The first line of the input is an integer T, being the number of test cases.
The first line of each test case are three integers A, B, C.
The second line of each test case are three integers x0, y0, z0.
The third line of each test case are three integers u0, v0, w0.
The last line of each test case is an integer N.
1 <= T <= 10^4
1 <= A, B, C <= 10^6
0 <= x0 <= A
0 <= y0 <= B
0 <= z0 <= C
-10^6 <= u0, v0, w0 <= 10^6
1 <= N <= 100 for small input, 1 <= N <= 10^9 for large input
For each test case, please output three integers x, y, z separated with a single space between them, describing the position at time N. Note that there should be no trailing space in the end (which means no space after z) and remember to add a \n in the end.