#include<algorithm>
#include"vector"
#include<string>
#include<iostream>
#include<fstream>
using namespace std;

#include<minmax.h>

ifstream fi("gunman.in");
ofstream fo("gunman.out");
typedef vector<int> veci;typedef vector<double> vecd;typedef vector<string> vecs;

#define forn(i,n) if(true)for(int i=0;i<(n);i++)
#define feach(i,v) forn(i,((int)v.size()))
#define VA(v) v.begin(),v.end()

int n;
struct WND{
	double x1,y1,x2,y2,z;
};
WND w[100];

int main(){
	fi>>n;
	forn(i,n){
		fi>>w[i].x1;
		fi>>w[i].y1;
		fi>>w[i].x2;
		fi>>w[i].y2;
		fi>>w[i].z;
	}

	int xf=1;
	double xmin,xmax;

	int yf=1;
	double ymin,ymax;
	
	forn(i,n){
		WND &a=w[i];

		double y1=a.y2/a.z;
		double y2=a.y1/a.z;
		if(y1>y2) swap(y1,y2);
		if(yf){
			ymin=y1;
			ymax=y2;
			yf=0;
		}
		ymin=max(ymin,y1);
		ymax=min(ymax,y2);

		forn(j,n){
			if(i==j) continue;
			
			WND &a=w[i],&b=w[j];
			double xx=(b.z*a.x1-a.z*b.x2)/(b.z-a.z);
			double xy=(a.z*b.x1-b.z*a.x2)/(a.z-b.z);

			if(xx>xy) swap(xx,xy);
			if(xf){
				xmin=xx;
				xmax=xy;
				xf=0;
			}
			xmin=max(xmin,xx);
			xmax=min(xmax,xy);
		}
	}
	
	int qf=1;
	double qmin,qmax;
		
	double x=xmin;
	forn(i,n){
		WND &a=w[i];

		double q1=(a.x2-x)/a.z;
		double q2=(a.x1-x)/a.z;
		if(q1>q2) swap(q1,q2);
		if(qf){
			qmin=q1;
			qmax=q2;
			qf=0;
		}
		qmin=max(qmin,q1);
		qmax=min(qmax,q2);
	}

	if(xmin>xmax || ymin>ymax || qmin>qmax){
		fo<<"UNSOLVABLE";
		return 0;
	}

	fo<<"SOLUTION"<<endl;

	char s[256];
	sprintf(s,"%0.6f",x);
	fo<<s<<endl;

	forn(i,n){
		WND &a=w[i];
		double curx=x+(qmin*a.z);
		double cury=(ymin*a.z);

		sprintf(s,"%0.6f %0.6f %0.6f",curx,cury,a.z);
		fo<<s<<endl;
	}

	return 0;
}