#include <stdio.h>

int sign(int n)
{
	if (n>0) return 1;
	if (n<0) return -1;
	return 0;
}

struct Point
{
	int z,x;
	int Compose(Point p)
	{
		return sign(x*p.z-z*p.x);
	}
	void Dec(Point P)
	{
		z-=P.z;
		x-=P.x;
	}
	void Inc(Point P)
	{
		z+=P.z;
		x+=P.x;
	}
	void Inverse()
	{
		z=-z;
		x=-x;
	}
	~Point(){;}
	Point(){;}
	Point(int Z, int X){z=Z;x=X;}
};

int inf=1005;

int Possible(Point *Left, Point *Right, int PLen, Point &Answer)
{
	Point PRight(1,inf);
	Point PLeft(1,-inf);
	for (int i=0;i<PLen;i++)
	{
		if (Left[i].Compose(PLeft)>0) PLeft=Left[i];
		if (Right[i].Compose(PRight)<0) PRight=Right[i];
	}
	if (PLeft.Compose(PRight)<=0)
	{
		Answer=PLeft;
		return 1;
	}
	return 0;
}

int PossibleXZ (Point *Left, Point *Right, int N, int index, Point &Answer)
{
	Point L[1000];
	Point R[1000];
	int Len=0,i;
	for (i=0;i<N;i++) if (i!=index)
	{
		L[Len]=Left[i];
		L[Len].Dec(Left[i]);
		if (L[Len].z<0) L[Len].Inverse();
		R[Len]=Right[i];
		R[Len].Dec(Left[i]);
		if (R[Len].z<0) R[Len].Inverse();
		Len++;
	}
	int t=Possible(L, R, Len, Answer);
	if (!t) return 0;
	Answer.Inc(Left[i]);
	return t;
}

int main()
{
	int X1[1000];
	int X2[1000];
	int Y1[1000];
	int Y2[1000];
	int Z[1000];
	FILE *f=fopen("gunman.in","rt");
	int N;
	fscanf(f,"%i",&N);
	for (int i=0;i<N;i++)
	{
		fscanf(f,"%i %i %i %i %i",X1+i,Y1+i, X2+i, Y2+i, Z+i);
	}
	fclose(f);

	Point Left[1000];
	Point Right[1000];
	for (i=0;i<N;i++)
	{
		Left[i]=Point(Z[i],Y1[i]);
		Right[i]=Point(Z[i],Y2[i]);
	}
	Point AnswerY;
	Point AnswerX1, AnswerX2;
	int Ans=Possible(Left, Right, N, AnswerY);
	for (i=0;i<N;i++)
	{
		Left[i]=Point(Z[i],X1[i]);
		Right[i]=Point(Z[i],X2[i]);
	}
	if (Ans)
	{
		Ans=0;
		for (int i=0;i<N && !Ans;i++)
		{
			Ans=PossibleXZ (Left, Right, N, i, AnswerX2);
			AnswerX1=Left[i];
		}
	}
	f=fopen("gunman.out","wt");
	if (!Ans)
	{
		fprintf(f,"UNSOLVABLE");
	}
	else
	{
		fprintf(f,"SOLUTION\n");
		double x = AnswerX1.x-((double)AnswerX1.z)*AnswerX2.x/AnswerX2.z;
		double _Z=1.;
		double _Y=((double)AnswerY.x)/AnswerY.z;
		double _X=((double)AnswerX2.x)/AnswerX2.z;
		fprintf(f,"%.6Lf",x);
		for (int i=0;i<N;i++)
		{
			fprintf(f,"\n%Lf %Lf %Lf",  1.*_X*Z[i]/_Z+x,  1.*_Y*Z[i]/_Z,  1.*Z[i]);
		}
	}
	fclose(f);
	return 0;
}
