Tommy cut several triangular holes out of sheets of paper, leaving each sheet with one triangular hole. He then divided each of the triangles he had cut out into two triangles with a single straight cut starting from one corner. That is, for each original triangle he cut straight from one of its three vertices to a point on the opposite side, splitting it into two pieces.
The resulting triangular pieces then got randomly scattered. Write a program that determines which two pieces fill each triangular hole — that is, which pieces go into which hole.
Each test case starts with an integer $n \le 20$, the number of holes that were cut out. It is followed by the coordinates of the holes, one hole per line; the holes are assumed to be numbered $1, 2, \dots, n$. After this come the coordinates of the $2n$ triangles resulting from the bisections, one triangle per line. These triangles are assumed to be numbered $1, 2, \dots, 2n$ and are listed in no particular order.
The specification of any hole or triangle has the form $x_1\ y_1\ x_2\ y_2\ x_3\ y_3$, where each $x_i$ and $y_i$ is given to the nearest thousandth and $|x_i|, |y_i| \le 200$. No two holes are congruent and no two triangles are congruent. A value of $n = 0$ terminates the input.
For each test case, output the case number and then $n$ lines as follows:
Hole 1: t1a, t1b
Hole 2: t2a, t2b
...
Hole n: tna, tnb
where $t1a, t1b$ are the two triangles that fill hole 1, $t2a, t2b$ are the two triangles that fill hole 2, and so on. Always print the lower of the two numbers first on each line. Triangles must not be flipped over when filling a hole (only rotation and translation are allowed). Each test case has a unique solution. Separate the output for each test case with a blank line.
Note: when processing the triangles and checking equality of lengths, angles, or trigonometric values, you may assume two items are equal if they differ by less than $0.01$.