A. Three seamarks

time limit per test

2.0 smemory limit per test

256 MBinput

standard inputoutput

standard outputThe "Victory" ship sailed away from the shore to participate in an international regatta. Having no positioning device onboard the ship went off the course and got lost in the seas. Luckily, the captain could see three seamarks through his binoculars with their coordinates known. As everyone knows, binoculars make it is possible not only to observe the objects, but also measure their angular sizes, i.e angles between straight lines connecting objects' corner points with an observing eye. For example, if two seamarks are located at points *M*_{1} and *M*_{2}, and the ship is at point *K*, then the angular size of segment *M*_{1}*M*_{2} is an angle *M*_{1}*KM*_{2}.

You need to find the ship's coordinates by given angular sizes of two segments connecting seamarks *M*_{1} and *M*_{2}, *M*_{2} and *M*_{3}.

Input

The first line contains an integer *n* — number of possible locations of the seamarks (1 ≤ *n* ≤ 50 000). Each of the next *n* lines contains eight integers. The first six integers describe Cartesian coordinates of different points *M*_{1}, *M*_{2}, *M*_{3} that do not exceed 10 000 by absolute value; the next two integers from the range [1; 179] are angular sizes (in degrees) of segments *M*_{1}*M*_{2} and *M*_{2}*M*_{3}. It is guaranteed that the solution exists for each of the test cases.

Output

For each location of the seamarks output coordinates of any possible ship position separated by space in a separate line. The answer will be considered correct if its absolute or relative error does not exceed 10^{ - 6}.

Examples

Input

1

0 0 2 0 2 2 90 90

Output

1.0000000000 1.0000000000

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/24/2019 12:54:28 (f3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|