Intersection of Two Lines

No attempts yetTime limit1sMemory limit128 MB

Problem

Given four points that define two lines, write a program that determines how the two lines are positioned relative to each other. The two lines may meet at exactly one point, never meet (they are parallel), or coincide completely.

Input

The first line contains the number of test cases $N$. ($1 \le N \le 10$)

Each of the next $N$ lines contains eight integers $x_1\ y_1\ x_2\ y_2\ x_3\ y_3\ x_4\ y_4$. They describe the first line passing through $(x_1, y_1)$ and $(x_2, y_2)$, and the second line passing through $(x_3, y_3)$ and $(x_4, y_4)$.

It is guaranteed that $(x_1, y_1)$ and $(x_2, y_2)$ are distinct points, and that $(x_3, y_3)$ and $(x_4, y_4)$ are distinct points.

All coordinates are integers in the range $-1000$ to $1000$.

Output

For each test case, print one line according to the following rules.

  • If the two lines meet at exactly one point $(x, y)$, print POINT x y. Here $x$ and $y$ are each rounded to exactly two decimal places.
  • If the two lines never meet (they are parallel and do not coincide), print NONE.
  • If the two lines coincide and therefore meet at infinitely many points, print LINE.

Do not print any header or footer such as INTERSECTING LINES OUTPUT or END OF OUTPUT.