#include <fstream.h>
#include <math.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
long N;
struct rect{
	long double lx, rx, ty, by, z;
	long double xi, yi;
} r[110];
int bad;
long double cx, cy, cz, lx, rx;

void Input(){
	long double t;
	cin >> N;
	for (long i = 0; i < N; i++){
		cin >> r[i].lx >> r[i].by >> r[i].rx >> r[i].ty >> r[i].z;
		if (r[i].lx > r[i].rx){
			t = r[i].lx;
			r[i].lx = r[i].rx;
			r[i].rx = t;
		}
		if (r[i].by > r[i].ty){
			t = r[i].ty;
			r[i].ty = r[i].by;
			r[i].by = t;
		}
	}
}

int check(long k){
	long double clx, crx, t;
	long i;
	lx = -1e16;
	rx = 1e16;
	for (i = 0; i < N; i++)
		if (i != k){
			clx = cx + cz * (cx - r[i].lx) / (r[i].z - cz);
			crx = cx + cz * (cx - r[i].rx) / (r[i].z - cz);
			r[i].yi = cy * r[i].z / cz;
			if (clx > crx){
				t = clx;
				clx = crx;
				crx = t;
			}
			if (clx > lx)
				lx = clx;
			if (crx < rx)
				rx = crx;
			if (lx > rx + 1e-8)
				return 0;
			if (r[i].yi > r[i].ty + 1e-8 || r[i].yi < r[i].by - 1e-8)
				return 0;
		}
	r[k].yi = cy;
	r[k].xi = cx;
	for (i = 0; i < N; i++)
		if (i != k)
			r[i].xi = lx + (cx - lx) * r[i].z / cz;
	return 1;
}

void Solve(){
	bad = 0;
	for (long i = 0; i < N; i++){
		cx = r[i].lx;
		cy = r[i].by;
		cz = r[i].z;
		if (check(i))
			return;
		cx = r[i].lx;
		cy = r[i].ty;
		if (check(i))
			return;
		cx = r[i].rx;
		cy = r[i].by;
		if (check(i))
			return;
		cx = r[i].rx;
		cy = r[i].ty;
		if (check(i))
			return;
	}
	bad = 1;
}

void Output(){
	if (bad)
		cout << "UNSOLVABLE";
	else{
		cout << "SOLUTION\n";
		cout.precision(6);
		cout.setf(ios::fixed | ios::showpoint);
		cout << lx << "\n";
		for (long i = 0; i < N; i++)
			cout << r[i].xi << " " << r[i].yi << " " << r[i].z << "\n";
	}
}

int main(){
	ifstream fi("gunman.in");
	ofstream fo("gunman.out");
	cin = fi;
	cout = fo;
	Input();
	Solve();
	Output();
	return 0;
}
