#include <cstdio>
#include <cmath>

FILE* fin=fopen("gunman.in","rt");
FILE* fout=fopen("gunman.out","wt");

const double PI=3.1415926535897932384626433832795;

class vc
{
public:
	double x, y, z;
};

int main()
{
	int n, i, j;
	double targetX;
	vc starts[102];
	vc stops[102];
	fscanf(fin,"%d",&n);
	for (i=0; i<n; ++i)
	{
		int nnnum;
		fscanf(fin,"%d",&nnnum);
		starts[i].x=nnnum;
		fscanf(fin,"%d",&nnnum);
		starts[i].y=nnnum;
		fscanf(fin,"%d",&nnnum);
		stops[i].x=nnnum;
		fscanf(fin,"%d",&nnnum);
		stops[i].y=nnnum;
		fscanf(fin,"%d",&nnnum);
		starts[i].z=nnnum;
		stops[i].z=nnnum;
	}

	double globalxmin=-1e20;
	double globalxmax=1e20;

	double xmin=0;
	double xmax=0;
	
	for (i=1; i<n; ++i)
	{
		for (j=0; j<i; ++j)
		{
			double k;
			k=((starts+i)->z-(stops+j)->z)/((starts+i)->x-(stops+j)->x);
			xmin=(starts+i)->x-(starts+i)->z/k;

			k=((stops+i)->z-(starts+j)->z)/((stops+i)->x-(starts+j)->x);
			xmax=(stops+i)->x-(stops+i)->z/k;

			if (xmin>xmax)
			{
				double temp=xmin;
				xmin=xmax;
				xmax=temp;
			}


			if (xmin>globalxmin)
				globalxmin=xmin;
			if (xmax<globalxmax)
				globalxmax=xmax;
		}
	}

	if (globalxmin>globalxmax)
	{
		fprintf(fout,"UNSOLVABLE");
		fclose(fin);
		fclose(fout);
		return 0;
	}

	double maxxstart=-1000000;
	for (i=0; i<n; ++i)
		if (starts[i].x>maxxstart)
		{
			maxxstart=starts[i].x;
			j=i;
		}

	double targetxK=starts[j].z/(starts[j].x-globalxmin);
	targetX=globalxmin;

	double gtmin=0;
	double gtmax=PI/2;

	double theta=0;
	for (i=0;i<n;++i)
	{
		theta=atan2(starts[i].y,starts[i].z);
		if (gtmin<theta)
			gtmin=theta;
		
		theta=atan2(stops[i].y,stops[i].z);
		if (gtmax>theta)
			gtmax=theta;
	}

	if (gtmin>gtmax)
	{
		fprintf(fout,"UNSOLVABLE");
		fclose(fin);
		fclose(fout);
		return 0;
	}

	double targettheta=gtmin;

	fprintf(fout,"SOLUTION\n%.6lf\n",targetX);
	for (i=0; i<n; ++i)
	{
		fprintf(fout,"%.6lf %.6lf %.6lf\n",
			targetX+starts[i].z/targetxK,
			starts[i].z*tan(targettheta),
			starts[i].z
			);
	}

	fclose(fin);
	fclose(fout);
	return 0;
}