Bob, an experienced candy hunter, is trying to track down a particularly tricky piece of candy on Halloween. He knows that the candy is located at a single point in -dimensional space, where , , and are integers. However, he does not know the point's exact coordinates.
Luckily, Bob has two trusty gadgets that he can use to pinpoint the location of the candy. First, using his sweetness detector, he has determined that the point is at a distance of exactly units away from the origin. In other words, its coordinates satisfy the equation . Next, using his sourness meter, he has determined that the point satisfies the formula , where is an unknown real number.
Now, Bob needs your help to find the exact coordinates of the point, or that a unique point with integer coordinates cannot be found (his gadgets could be malfunctioning).
Input Specification
The first line of input will contain a single integer, .
The next line will contain three space-separated integers, , , and .
The next line will contain three space-separated integers, , , and .
Output Specification
Output the values of , , and separated by spaces on a single line.
If a single point with integer coordinates cannot be found, output -1
instead.
Sample Input 1
10
6 8 6
0 0 6
Sample Output 1
6 8 0
Sample Input 2
2
10 10 10
-9 1 8
Sample Output 2
-1
Comments