Hide

Problem C
Completing the Square

In the heart of your home city, there is an old square, close to the train station, appropriately called Station Square. It used to look like a perfect square: four sides of equal length joined by right angles. However, it hasn’t looked like this for decades, as one of the four corners was destroyed by bombings in the Second World War. After the war, the square was rebuilt as a quarter circle, and it has looked like that ever since. (In other words, it looks like an isosceles right triangle, except that the hypothenuse is not a straight line but a circular arc.) This is illustrated in the figure below, which corresponds with Sample Input 1.

\includegraphics[width=0.6\textwidth ]{square-TikZ-with-labels.pdf}
Figure 1: Illustration of the first example input.

Recently, the city council voted to completely remodel the train station and its surroundings, which includes restoring Station Square to its original state. Therefore they need to determine the exact location of the fourth corner. This task is too complicated for ordinary aldermen, so the city decided to hire a top scientist. That would be you! Please help the city complete the square, and you will be greatly rewarded!

Input

There are three lines of input. Each line contains two integers denoting the $x$ and $y$ coordinates of one of the corners of the current square ($-10^4 \leq x,y\leq 10^4$).

Output

Output one line with two space-separated integers denoting the $x$ and $y$ coordinates of the long-lost fourth corner.

Sample Input 1 Sample Output 1
2 -5
-8 -1
-5 -8
-1 2
Sample Input 2 Sample Output 2
0 0
1 0
1 1
0 1
Sample Input 3 Sample Output 3
2 -1
-2 3
2 7
6 3

Please log in to submit a solution to this problem

Log in