Completing the Square

Given three corners of a square in any order, compute the coordinates of the missing fourth corner.

Easy3GeometryMathInterviewNo attempts yetTime limit1sMemory limit512 MB

Problem

In the middle of your home city, right next to the train station, there is an old plaza called Station Square. It used to be a perfect square: four sides of equal length meeting at right angles. It has not looked like that for decades, because bombing during the Second World War destroyed one of the four corners. After the war the city rebuilt the plaza as a quarter circle, and it has stayed that way. Think of an isosceles right triangle whose hypotenuse is a circular arc instead of a straight segment. The figures below show both shapes and correspond to the first example.

(a) The old plaza, an actual square. (b) The plaza today, closer to a quarter circle.

The city council recently voted to remodel the train station and its surroundings, and that work includes restoring Station Square to its original shape. The council needs the exact position of the corner that was lost. Given the coordinates of the three remaining corners, find the coordinates of the fourth one.

Input

The input has three lines. Each line contains two integers xx and yy, separated by a space, giving the coordinates of one corner of the plaza as it stands now (104x,y104-10^4 \le x, y \le 10^4).

The three points are three distinct corners of a square with positive side length, given in no particular order.

Output

Print one line with two space separated integers, the xx and yy coordinates of the missing fourth corner. The answer is always unique and both coordinates are integers, but they can fall outside the range of the input coordinates.