Euclid

Time limit1sMemory limit128 MB

Problem

Euclid wrote down an elaborate construction for the following problem in his notebook. With a computer, though, it is easy to compute.

On the two-dimensional plane there is a segment $AB$, a point $C$, and a triangle $DEF$. The point $C$ does not lie on line $AB$; equivalently, $A$, $B$, $C$ are not collinear, so a non-degenerate parallelogram can be built. You must find points $G$ and $H$ such that:

  1. $H$ lies on the ray that starts at $A$ and goes through $C$.
  2. $ABGH$ is a parallelogram (with its vertices in this order).
  3. The area of parallelogram $ABGH$ equals the area of triangle $DEF$.

Input

The input consists of several test cases. Each test case is a list of 12 real numbers, none of which has more than 3 digits after the decimal point:

AX AY BX BY CX CY DX DY EX EY FX FY

The coordinates of $A$ are $(AX, AY)$, of $B$ are $(BX, BY)$, and so on for the other points. Points $A$, $B$, $C$ are pairwise distinct and not collinear, and $D$, $E$, $F$ form a triangle (they too are pairwise distinct and not collinear, so its area is positive). Every number lies in the closed interval from $-1000.0$ to $1000.0$. The input ends with a line of twelve $0.0$ values.

Output

For each test case, output four real numbers — the coordinates of $G$ and $H$ — in the format:

GX GY HX HY

Here $G = (GX, GY)$ and $H = (HX, HY)$. Every value must be rounded to 3 decimal places (rounding at the 4th decimal place) and printed with exactly 3 digits after the decimal point. Print a single space between consecutive numbers.