cho.sh
Notes
Loading...

Fourth Point

Time limit

2s

Memory limit

128 MB

Problem

Two adjacent sides of a parallelogram are given. Each side is represented by the coordinates of its two endpoints, and the two sides share one vertex.

Using the three given vertices, find the remaining vertex of the parallelogram, the fourth point.

Input

The input contains multiple lines. Each line contains 8 real numbers.

The first four numbers are the (x, y) coordinates of the two endpoints of the first side, and the next four numbers are the (x, y) coordinates of the two endpoints of the second side. All coordinates are in meters and may be written to millimeter precision. Each coordinate is between -10000 and 10000, inclusive.

Output

For each input line, print the x y coordinates of the fourth point on one line. Print the coordinates in meters with exactly three digits after the decimal point.