beecrowd | 3081


By Guilherme Londe, PUC Goiás BR Brazil

Timelimit: 1

A space agency is monitoring several satellites orbiting the earth globe. Recently their control system is having problems and then they asked you to help building a program to predict the positions of the satellites on space.

The space is a three-dimensional coordinates system in which the origin is the center of the earth. We disconsider any movement of the planet by itself or by another celestial object. The orbit of a satellite consists of a circumference with center on the origin of the space (see the image below). A satellite always travels its orbit at a constant speed.

The agency observes the position of the satellites at each unit of time and is informed to you the position of a satellite on the instants 0 and 1. Write a program that predicts the position of this satellite at the instant k.


The input consists of several test cases. The first line of each test contains six real values AxAyAzBxBy and Bz  (-109 ≤ AxAyAzBxByBz ≤ 109), both containing six digits after the decimal point, where the first three values represents the position of a satellite at the instant 0 and the next three represents the position at the instant 1. The second line of each test case contains an integer value k (0 ≤ k ≤ 109).


For each test case just output one line with three real values PxPy and Pz rounded to three digits after the decimal point, that represents the position of the satellite at the instant  k.

Input Sample Output Sample

0.000000 0.000000 -2.000000 1.414214 1.414214 0.000000
2.819078 0.991098 0.265564 2.457456 1.474953 0.886241

-1.414 -1.414 0.000
1.891 1.836 1.433