#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define pii pair<int, int>
#define mkpii make_pair<int, int>
#define pdi pair<double, int>
#define mkpdi make_pair<double, int>
#define pli pair<ll, int>
#define mkpli make_pair<ll, int>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define for1(i,a,n) for(int i=(a);i<=(n);++i)
#define for2(i,a,n) for(int i=(a);i<(n);++i)
#define for3(i,a,n) for(int i=(a);i>=(n);--i)
#define for4(i,a,n) for(int i=(a);i>(n);--i)
#define CC(i,a) memset(i,a,sizeof(i))
#define read(a) a=getint()
#define print(a) printf("%d", a)
#define dbg(x) cout << (#x) << " = " << (x) << endl
#define error(x) (!(x)?puts("error"):0)
#define printarr2(a, b, c) for1(_, 1, b) { for1(__, 1, c) cout << a[_][__]; cout << endl; }
#define printarr1(a, b) for1(_, 1, b) cout << a[_] << '\t'; cout << endl
inline const int getint() { int r=0, k=1; char c=getchar(); for(; c<'0'||c>'9'; c=getchar()) if(c=='-') k=-1; for(; c>='0'&&c<='9'; c=getchar()) r=r*10+c-'0'; return k*r; }
inline const int max(const int &a, const int &b) { return a>b?a:b; }
inline const int min(const int &a, const int &b) { return a<b?a:b; }
const double eps=1e-6;
struct Pt { double x, y; Pt(double _x=0, double _y=0) : x(_x), y(_y) {} };
int dcmp(double a) { if(abs(a)<eps) return 0; return a<0?-1:1; }
typedef Pt Vt;
Vt operator+ (const Pt &a, const Pt &b) { return Vt(a.x+b.x, a.y+b.y); }
Vt operator- (const Pt &a, const Pt &b) { return Vt(a.x-b.x, a.y-b.y); }
Vt operator* (const Pt &a, const double &b) { return Vt(a.x*b, a.y*b); }
bool operator== (const Pt &a, const Pt &b) { return dcmp(a.x-b.x)==0 && dcmp(a.y-b.y)==0; }
double Cross(Vt a, Vt b) { return a.x*b.y-b.x*a.y; }
struct Line {
Pt p; Vt v;
Line() {}
Line(Pt &a, Pt &b) { p=a; v=b-a; }
};
Pt getLLP(Line &a, Line &b) {
static Pt p, q;
static Vt u, w, v;
p=a.p; q=b.p;
v=a.v; w=b.v;
u=p-q;
double t1=Cross(w, u)/Cross(v, w);
return p+v*t1;
}
// -1:xiangjiao 0:chonghe 1:pingxing
int LineAndLine(Line &p, Line &q) {
if(dcmp(Cross(p.v, q.v))!=0) return -1;
return dcmp(Cross(q.p-p.p, q.v))==0 && dcmp(Cross(q.p-p.p, p.v))==0;
}
int main() {
int n;
while(~scanf("%d", &n)) {
puts("INTERSECTING LINES OUTPUT");
Line l[2]; Pt p[4];
while(n--) {
rep(k, 4) scanf("%lf%lf", &p[k].x, &p[k].y);
l[0]=Line(p[0], p[1]);
l[1]=Line(p[2], p[3]);
int c=LineAndLine(l[0], l[1]);
if(c==-1) { Pt pt=getLLP(l[0], l[1]); printf("POINT %.2f %.2f\n", pt.x, pt.y); }
else if(c==0) puts("NONE");
else puts("LINE");
}
puts("END OF OUTPUT");
}
return 0;
}