#include <stdio.h>
#include <string.h>
#include <math.h>
#define truestr "SOLUTION"
#define falsestr "UNSOLVABLE"

int n,k;
double wx1[100],wx2[100],wy1[100],wy2[100],wz[100],gx1,gx2,ga1,ga2;


int main()
{
	int i,j;k=0;
	double lowy,highy;
	double hx1,hx2,ha1,ha2,hz;
	freopen("gunman.in","r",stdin);
	freopen("gunman.out","w",stdout);
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		double x1,x2,y1,y2;
		scanf("%lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&wz[i]);
		wx1[i]=x1;
		wx2[i]=x2;
		wy1[i]=y1;
		wy2[i]=y2;
		if (i==0)
		{
			lowy=wy1[i]/wz[i];
			highy=wy2[i]/wz[i];
		} else
		{
			if (wy1[i]/wz[i]>lowy) lowy=wy1[i]/wz[i];
			if (wy2[i]/wz[i]<highy) highy=wy2[i]/wz[i];
		}
	}

	ga1=(wx2[n-1]-wx1[0])/(wz[n-1]-wz[0]);
	ga2=(wx1[n-1]-wx2[0])/(wz[n-1]-wz[0]);
	gx1=wx1[0]-ga1*wz[0];
	gx2=wx2[0]-ga2*wz[0];
	if (lowy>highy) {printf(falsestr);return 0;}
	for (i=0;i<n-2;i++)
		for (j=i+1;j<n-1;j++)
		{
			ha1=(wx2[j]-wx1[i])/(wz[j]-wz[i]);
			hx1=wx1[i]-ha1*wz[i];
			ha2=(wx1[j]-wx2[i])/(wz[j]-wz[i]);
			hx2=wx2[i]-ha2*wz[i];
			if (hx1>gx1) {gx1=hx1;ga1=ha1;}
			if (hx2<gx2) {gx2=hx2;ga2=ha2;}
		}

	if (gx1>gx2) {printf(falsestr);return 0;}
	printf("SOLUTION\n");
	printf("%.6lf\n",gx1);
	for (i=0;i<n;i++)
		printf("%.6lf %.6lf %.6lf\n",gx1+ga1*wz[i],lowy*wz[i],wz[i]);
	return 0;

}