// 直线相交 POJ 1269
// #include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <math.h>
using namespace std;
#define LL long long
typedef pair<int,int> pii;
const double inf = 123456789012345.0;
const LL MOD =100000000LL;
const int N =1e4+;
#define clc(a,b) memset(a,b,sizeof(a))
const double eps = 1e-;
void fre() {freopen("in.txt","r",stdin);}
void freout() {freopen("out.txt","w",stdout);}
inline int read() {int x=,f=;char ch=getchar();while(ch>''||ch<'') {if(ch=='-') f=-; ch=getchar();}while(ch>=''&&ch<='') {x=x*+ch-'';ch=getchar();}return x*f;}
int sgn(double x){
if(fabs(x) < eps)return ;
if(x < )return -;
else return ;
}
struct Point{
double x,y;
Point(){}
Point(double _x,double _y){
x = _x;y = _y;
}
Point operator -(const Point &b)const{
return Point(x - b.x,y - b.y);
}
double operator ^(const Point &b)const{
return x*b.y - y*b.x;
}
double operator *(const Point &b)const{
return x*b.x + y*b.y;
}
};
struct Line{
Point s,e;
Line(){}
Line(Point _s,Point _e){
s=_s;e=_e;
}
pair<int,Point> operator & (const Line &b) const{
Point res=s;
if(sgn((s-e)^(b.s-b.e))==){
if(sgn((s-b.e)^(b.s-b.e))==)
return make_pair(,res);
else return make_pair(,res);
}
double t=((s-b.s)^(b.s-b.e))/((s-e)^(b.s-b.e));
res.x+=(e.x-s.x)*t;
res.y+=(e.y-s.y)*t;
return make_pair(,res);
}
};
int main(){
int T;
scanf("%d",&T);
double x1,x2,x3,x4,y1,y2,y3,y4;
printf("INTERSECTING LINES OUTPUT\n");
while(T--){
scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
Line line1 = Line(Point(x1,y1),Point(x2,y2));
Line line2 = Line(Point(x3,y3),Point(x4,y4));
pair<int,Point> ans=line1 & line2;
if(ans.first==) printf("LINE\n");
else if(ans.first==) printf("NONE\n");
else printf("POINT %.2f %.2f\n",ans.second.x,ans.second.y);
}
printf("END OF OUTPUT\n");
return ;
}