#include<stdio.h>
#include<math.h>
void main()
{
	FILE *fin,*fout;
	double x1[200],x2[200],y1[200],y2[200],z[200];
	double xsb,xsd,ys,yw1,yw2,zwy,ytmp1,ytmp2,xwd1,xwd2,xwb1,xwb2,xtmp1,xtmp2;
	double xtmp,ytmp;
	int n,i;
	fin=fopen("gunman.in","r");
	fscanf(fin,"%d",&n);
	for(i=0;i<n;i++)
		fscanf(fin,"%lf%lf%lf%lf%lf",&x1[i],&y1[i],&x2[i],&y2[i],&z[i]);
	fclose(fin);
	zwy=z[n-1];
	yw1=-1e100;
	yw2=1e100;
	for(i=0;i<n;i++)
	{
		ytmp1=zwy/z[i]*y1[i];
		ytmp2=zwy/z[i]*y2[i];
		if(ytmp1>yw1)
			yw1=ytmp1;
		if(ytmp2<yw2)
			yw2=ytmp2;
	}
	fout=fopen("gunman.out","w");
	if(yw2<yw1)
	{
		fprintf(fout,"UNSOLVABLE");
		fclose(fout);
		return;
	}
	xwd1=x1[n-1];
	xwd2=x2[n-1];
	xwb1=-1e100;
	xwb2=1e100;
	for(i=n-2;i>=0;i--)
	{
//		xtmp1=xwd1-z[n-1]*(x2[i]-xwd1/*x1[n-1]*/)/(z[n-1]-z[i]);
//		xtmp2=xwd2-z[n-1]*(x1[i]-xwd2/*x2[n-1]*/)/(z[n-1]-z[i]);
		xtmp1=xwd2+(z[n-1]/(z[n-1]-z[i]))*(x1[i]-xwd2);
		xtmp2=xwd1+(z[n-1]/(z[n-1]-z[i]))*(x2[i]-xwd1);
		if(xtmp1>xwb1)
			xwb1=xtmp1;
		if(xtmp2<xwb2)
			xwb2=xtmp2;
	}
	if(xtmp1>xtmp2)
	{
		fprintf(fout,"UNSOLVABLE");
		fclose(fout);
		return;
	}
	xsb=(xwb2+xwb1)/2;
	xsd=(xwd2+xwd1)/2;
	ys=(yw2+yw1)/2;
	fprintf(fout,"SOLUTION\n");
	fprintf(fout,"%.6lf\n",xsb);
	for(i=0;i<n;i++)
	{
		xtmp=xsd-(xsd-xsb)*(z[n-1]-z[i])/z[n-1];
		ytmp=ys*z[i]/z[n-1];
		fprintf(fout,"%.6lf %.6lf %.6lf\n",xtmp,ytmp,double(z[i]));
	}
	fclose(fout);
}