#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;
//英语 看博友分析 抄博友程序 分别给出两条直线上的两点求直线关系 背
int main()
{
int T;
cin>>T;
cout<<"INTERSECTING LINES OUTPUT"<<endl;
while(T--)
{
double x1,y1,x2,y2,x3,y3,x4,y4;
cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
if(x1==x2 && x3==x4)
{
if(x1==x3)
{
cout<<"LINE"<<endl;
}else
{
cout<<"NONE"<<endl;
}
}else if(x1==x2)
{
double k=(y3-y4)/(x3-x4);
double b=y3-k*x3;
cout<<"POINT ";
cout<<fixed<<setprecision(2)<<x1<<" "<<k*x1+b<<endl;
}else if(x3==x4)
{
double k=(y1-y2)/(x1-x2);
double b=y1-k*x1;
cout<<"POINT ";
cout<<fixed<<setprecision(2)<<x3<<" "<<k*x3+b<<endl;
}else
{
double k1=(y1-y2)/(x1-x2);
double b1=y1-k1*x1;
double k2=(y3-y4)/(x3-x4);
double b2=y3-k2*x3;
if(k1==k2 && b1==b2)
{
cout<<"LINE"<<endl;
}else if(k1==k2)
{
cout<<"NONE"<<endl;
}else
{
double x=(b2-b1)/(k1-k2);
cout<<"POINT ";
cout<<fixed<<setprecision(2)<<x<<" "<<k1*x+b1<<endl;
}
}
}
cout<<"END OF OUTPUT"<<endl;
return 0;
}