#include <stdio.h>
#define eps 0.000001

FILE *f;
int wnd[100][4];
int z[100];
int n;

int check(int z1, int x1, int z2, int x2)
{
	double x; int s=1; int i;
	for(i=0; i<n; i++)
	{
		if((z[i]==z1)||(z[i]==z2)) continue;
		x = (double)x1+((double)(x2-x1))*((double)(z[i]-z1))/((double)(z2-z1));
		if((x<wnd[i][0]-eps)||(x>wnd[i][1]+eps)) {s=0; break;}
	}
	return s;
}

void makeVyvod(int z1, int x1, int z2, int x2, int y, int z3)
{
	int i;
	fprintf(f, "%.6lf\n", (double)x1+((double)(x2-x1))*((double)(-z1))/((double)(z2-z1)));
	for(i=0; i<n; i++)
	{
		fprintf(f, "%.6lf %.6lf %.6lf\n",
			(double)x1+((double)(x2-x1))*((double)(z[i]-z1))/((double)(z2-z1)),
			((double)(y))*((double)(z[i]))/((double)(z3)),
			(double)z[i]);
	}
}

int main()
{
	int i, j, q, qq;
	int i1, i2, j1;
	int x, y;

	f = fopen("gunman.in","rt");
	fscanf(f, "%d", &n);
	for(i=0; i<n; i++)
	{
		fscanf(f, "%d %d %d %d %d", &wnd[i][0], &wnd[i][1], &wnd[i][2], &wnd[i][3], &z[i]);
	}
	fclose(f);
	//nahodim x koordinatu
	q=-1;
	for(i=0; i<n; i++) for(j=0; j<n; j++)
	{
		if(i==j) continue;
		if(check(z[i], wnd[i][0], z[j], wnd[j][0])) q=0;
		if(check(z[i], wnd[i][0], z[j], wnd[j][2])) q=1;
		if(check(z[i], wnd[i][2], z[j], wnd[j][0])) q=2;
		if(check(z[i], wnd[i][2], z[j], wnd[j][2])) q=3;
		if(q!=-1) goto D;
	}
D:	i1=i; j1=j;
	//nahodim y koordinatu
	qq=-1;
	for(i=0; i<n; i++)
	{
		if(check(0,0, z[i], wnd[i][1])) qq=0;
		if(check(0,0, z[i], wnd[i][3])) qq=1;
		if(qq!=-1) break;
	}
	i2=i;
	f = fopen("gunman.out","wt");
	if((q==-1)||(qq==-1)) fprintf(f, "UNSOLVABLE\n");
	else
	{
		fprintf(f, "SOLUTION\n");
		//oformljaem vyvod
		y = (qq==0 ? wnd[i2][1] : wnd[i2][3]);
		if(q==0) makeVyvod(z[i1],wnd[i1][0],z[j1],wnd[j1][0],y,z[i2]);
		if(q==1) makeVyvod(z[i1],wnd[i1][0],z[j1],wnd[j1][2],y,z[i2]);
		if(q==2) makeVyvod(z[i1],wnd[i1][2],z[j1],wnd[j1][0],y,z[i2]);
		if(q==3) makeVyvod(z[i1],wnd[i1][2],z[j1],wnd[j1][2],y,z[i2]);
	}
	fclose(f);

	return 0;
}