#include	<stdio.h>

#define	INF	1E10
#define	EPS	1E-10

#include	<vector>
using namespace std;

struct TRect
{
	double x1, y1, x2, y2, z;
};

struct TPoint
{
	double x, y;

	TPoint(double _x, double _y)
	{
		x = _x;
		y = _y;
	}

	TPoint(void)
	{
	
	}
};
typedef vector<TPoint> TPoints;

struct TLine
{
	double A, B, C;
	
	TLine(const TPoint& a, const TPoint& b)
	{
		A = a.y - b.y;
		B = b.x - a.x;
		C = -(A*a.x + B*b.y);
	}

	TLine(void)
	{
	
	}

	double Dist(const TPoint& p)
	{
		return A*p.x + B*p.y + C;
	}
};

bool DiffSign(double a, double b)
{
	if (a < EPS && b > -EPS)
		return true;
	if (b < EPS && a > -EPS)
		return true;
	return false;
}

TPoint LineIntersect(const TLine& a, const TLine& b)
{
	double D = a.A*b.B - a.B*b.A;

	TPoint result;
	result.x = -(a.C*b.B - a.B*b.C) / D;
	result.y = (a.A*b.C - a.C*b.A) / D;

	return result;
}

int n;
TRect rects[100];

bool GoodPoint(const TPoint& p)
{
	int i = 0;
	while ( (i < n) && ( p.x + p.y*rects[i].z >= rects[i].x1 - EPS) )
		++i;
	if ( i < n )
		return false;
	i = 0;
	while ( (i < n) && ( p.x + p.y*rects[i].z <= rects[i].x2 + EPS) )
		++i;
	if ( i < n )
		return false;

	return true;
}

int main(void)
{
	freopen("gunman.in", "r", stdin);
	//freopen("gunman.out", "w", stdout);
	
	scanf("%d", &n);

	int i;
	for (i = 0; i < n; ++i)
		scanf("%lf %lf %lf %lf %lf", &rects[i].x1, &rects[i].y1, &rects[i].x2, &rects[i].y2, &rects[i].z);

	double miny = INF, maxy = -INF;

	for (i = 0; i < n; ++i)
	{
		if ( rects[i].y1 / rects[i].z < miny )
			miny = rects[i].y1 / rects[i].z;
		if ( rects[i].y2 / rects[i].z > maxy )
			maxy = rects[i].y2 / rects[i].z;
	}

	if ( miny - EPS < maxy + EPS )
	{
		bool good = false;
		TPoint ans;
		if ( GoodPoint( TPoint(0, 0) ) )	
		{
			good = true;
			ans = TPoint(0, 0);
		}
		if ( GoodPoint( TPoint(0, 10000) ) )	
		{
			good = true;
			ans = TPoint(0, 10000);
		}
		if ( GoodPoint( TPoint(10000, 0) ) )	
		{
			good = true;
			ans = TPoint(10000, 0);
		}
		if ( GoodPoint( TPoint(10000, 10000) ) )	
		{
			good = true;
			ans = TPoint(10000, 10000);
		}

			for (i = 0; i < n; ++i)
				for (int j = i + 1; j < n; ++j)
				{
					TLine a;
					a.A = 1;
					a.B = rects[i].z;
					a.C = -rects[i].x1;

					TLine b;
					b.A = 1;
					b.B = rects[j].z;
					b.C = -rects[j].x1;

					TPoint ints = LineIntersect(a, b);
					if ( GoodPoint(ints) )
					{
						good = true;
						ans = ints;
					}
				}
			for (i = 0; i < n; ++i)
				for (int j = i + 1; j < n; ++j)
				{
					TLine a;
					a.A = 1;
					a.B = rects[i].z;
					a.C = -rects[i].x2;

					TLine b;
					b.A = 1;
					b.B = rects[j].z;
					b.C = -rects[j].x1;

					TPoint ints = LineIntersect(a, b);
					if ( GoodPoint(ints) )
					{
						good = true;
						ans = ints;
					}
				}
			for (i = 0; i < n; ++i)
				for (int j = i + 1; j < n; ++j)
				{
					TLine a;
					a.A = 1;
					a.B = rects[i].z;
					a.C = -rects[i].x1;

					TLine b;
					b.A = 1;
					b.B = rects[j].z;
					b.C = -rects[j].x2;

					TPoint ints = LineIntersect(a, b);
					if ( GoodPoint(ints) )
					{
						good = true;
						ans = ints;
					}
				}
			for (i = 0; i < n; ++i)
				for (int j = i + 1; j < n; ++j)
				{
					TLine a;
					a.A = 1;
					a.B = rects[i].z;
					a.C = -rects[i].x2;

					TLine b;
					b.A = 1;
					b.B = rects[j].z;
					b.C = -rects[j].x2;

					TPoint ints = LineIntersect(a, b);
					if ( GoodPoint(ints) )
					{
						good = true;
						ans = ints;
					}
				}
		
		if (good)
		{
			double dy = (miny + maxy) / 2.0;

			printf("SOLUTION\n");
			printf("%.6lf\n", ans.x);
			for (int i = 0; i < n; ++i)
				printf("%.6lf %.6lf %.6lf\n", ans.x + ans.y*rects[i].z, dy*rects[i].z, rects[i].z);
		}
		else
			printf("UNSOLVABLE\n");

		/*
		TPoints points;
		points.push_back( TPoint(0, 0) );
		points.push_back( TPoint(0, 10000) );
		points.push_back( TPoint(10000, 10000) );
		points.push_back( TPoint(10000, 0) );

		TPoint newPoints;
		for (i = 0; i < n; ++i)
		{
			newPoints.push_back(points[i]);

			TPoint point = points[i];
			TPoint nextPoint = points[ (i + 1) % points.size() ];
		
			TLine b;
			b.a = 1;
			b.b = rects[i].y;
			b.c = -rects[i].x1;

			if ( DiffSign(b.Dist(point), b.Dist(nextPoint)) )
			{
				TLine a(point, point);			
				TPoint ints = LineIntersect(a, b);
				newPoints.push_back(ints);
			}
		}
		*/
			
	}
	else
		printf("UNSOLVABLE\n");


	return 0;
}