#include <fstream>
#include <cmath>
using namespace std;
ifstream in("gunman.in");
ofstream out("gunman.out");

int main()
{
	double x1[100], x2[100], y1[100], y2[100],z[100];
	int N;

	in >> N;

	int i,j;

	for (i=0;i<N;i++)
	{
		in >> x1[i];
		in >> y1[i];
		in >> x2[i];
		in >> y2[i];
		in >> z[i];
	}

	double f1,f2;
	double tmpf1, tmpf2;

	f2=((double)y2[0])/z[0];
	f1=((double)y1[0])/z[0];

	for (i=1;i<N;i++)
	{
		tmpf2=((double)y2[i])/z[i];
		tmpf1=((double)y1[i])/z[i];

		if (tmpf2 < f2)
			f2=tmpf2;
		if (tmpf1 > f1)
			f1=tmpf1;
		if (f1>f2)
		{
			out << "UNSOLVABLE\n";
			return 0;
		}
	}


	double pos1,pos2;
	double tmppos1,tmppos2;
	int indx=0;
	double xshot=x1[0];

	pos1=-((((double)x1[1]-x2[0])/(z[0]-z[1]))*z[0]-x1[0]);
	pos2=-((((double)x2[1]-x1[0])/(z[0]-z[1]))*z[0]-x2[0]);

//	out << pos1 << ' ' << pos2 << '\n';

	for (i=2;i<N;i++)
		for (j=i-1;j>=0;j--)
		{
//			tmppos1=-((((double)x1[i]-x2[j])/(z[j]-z[i]))*z[j]-x1[j]);
//			tmppos2=-((((double)x2[i]-x1[j])/(z[j]-z[i]))*z[j]-x2[j]);
			tmppos2=x2[j]-(double)z[j]*(x1[i]-x2[j])/(z[i]-z[j]);
			tmppos1=x1[j]-(double)z[j]*(x2[i]-x1[j])/(z[i]-z[j]);

//			out << i << ' ' << j << ' ' << tmppos1 << ' ' << tmppos2 << '\n';


			if (tmppos2 < pos2)
				pos2=tmppos2;
			if (tmppos1 > pos1)
			{
				pos1=tmppos1;
				indx=i;
				xshot=x2[i];
			}
			if ( pos1>pos2 )
			{
				out << "UNSOLVABLE\n";
				return 0;
			}
		}

//	out << pos1 << ' ' << pos2;
//	pos1=-1;
	pos1=(pos1+pos2)/2;
	double xf1,xf2;
	double txf1,txf2;
	xf1=(x1[0]-pos1)/z[0];
	xf2=(x2[0]-pos1)/z[0];
	for(i=1;i<N;i++)
	{
		txf1=(x1[i]-pos1)/z[i];
		txf2=(x2[i]-pos1)/z[i];
		if (txf1 > xf1)
			xf1=txf1;
		if (txf2 < xf2)
			xf2=txf2;
	}

	double xf=(xf1+xf2)/2;

//		out << txf1 << ' ' << txf2 << endl;

	out << "SOLUTION\n";
	out.precision(6);
	out.setf(ios::fixed | ios::showpoint);
	out << pos1 << '\n';
	
//	double k=(double)z[indx]/(x2[indx]-pos1);
//	double b=-k*pos1;
//  out << indx << endl;
	for (i=0;i<N;i++)
	{
//		out << (z[i]-b)/k;
//		out << pos1+(xshot-pos1)*z[i]/z[indx];
		out << pos1+xf*z[i];
		 
		out << ' ';
		out << z[i]*f1;
		out << ' ';
		out << (double)z[i];
		out << '\n';
	}
	return 0;
}
