#include <float.h>
#include <math.h>
#include <stdio.h>
#include <fstream>
using namespace std;

#define eps 1.0e-10

int main()
{
	int n, i, j;
	double x1[100], x2[100], y1[100], y2[100], z[100];

	ifstream in("gunman.in");
	in >> n;
	for (i=0; i<n; i++)
		in >> x1[i] >> y1[i] >> x2[i] >> y2[i] >> z[i];
	in.close();

	double py, py1=0, py2=DBL_MAX, pz;
	bool solve = true, init = false;

	for (i=0; i<n; i++)
	{
		py = y1[i] / hypot(y1[i], z[i]);

		if (py1 < py) py1 = py;
		if (py2 < py - eps && init)
		{
			solve = false;
			break;
		}

		py = y2[i] / hypot(y2[i], z[i]);

		if (py2 > py) py2 = py;
		if (py1 > py + eps && init)
		{
			solve = false;
			break;
		}

		init = true;
	}

	py = (py1 + py2) / 2;
	pz = sqrt(1 - py*py);

	double px1=-DBL_MAX, px2=DBL_MAX, px, k1, k2, k;
	init = false;

	for (i=1; i<n; i++)
		for (j=0; j<i; j++)
		{
			px = x1[i] + (x2[j] - x1[i]) * z[i] / (z[i] - z[j]);

			if (px2 > px)
			{
				px2 = px;
				k2 = (x1[i] - px) / z[i];
			}
			if (px1 > px + eps && init)
			{
				solve = false;
				break;
			}

			px = x2[i] - (x2[i] - x1[j]) * z[i] / (z[i] - z[j]);

			if (px1 < px)
			{
				px1 = px;
				k1 = (x2[i] - px) / z[i];
			}
			if (px2 < px - eps && init)
			{
				solve = false;
				break;
			}
		
			init = true;
		}

	px = (px1 + px2) / 2;
	k = (k1 + k2) / 2;

	FILE *out = fopen("gunman.out", "w");

	if (solve)
	{
		fprintf(out, "SOLUTION\n%.6lf\n", px);
		for (i=0; i<n; i++)
		{
			float xx = px + z[i] * k, yy = z[i] * py / pz;
			fprintf(out, "%.6lf %.6lf %.6lf\n", xx, yy, z[i]);
		}
	}
	else fprintf(out, "UNSOLVABLE\n");

	fclose(out);

	return 0;
}
