#include <stdio.h>

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

rect lang[110];

int main() {
	int N, i, temp, j;
	double min, max, shX, shY, shPX, x1, x2, tmp;
	FILE *f = fopen("gunman.in", "r");
	fscanf(f, "%d", &N);
	for (i=0; i<N; i++) {
		fscanf(f, "%d", &temp);
		lang[i].x1 = temp;
		fscanf(f, "%d", &temp);
		lang[i].y1 = temp;
		fscanf(f, "%d", &temp);
		lang[i].x2 = temp;
		fscanf(f, "%d", &temp);
		lang[i].y2 = temp;
		fscanf(f, "%d", &temp);
		lang[i].z = temp;
	}
	f = fopen("gunman.out", "w");
	min = lang[0].y2/lang[0].z;
	max = lang[0].y1/lang[0].z;
	for (i=1; i<N; i++) {
		if (min>lang[i].y2/lang[i].z) min = lang[i].y2/lang[i].z;
		if (max<lang[i].y1/lang[i].z) max = lang[i].y1/lang[i].z;
	}
	if (min<max) {
		fprintf(f, "UNSOLVABLE");
		return 0;
	}
	shY = (min+max)/2;
	min = 1000000000.0;
	max = -1000000000.0;

	for (i=0; i<N; i++)
		for (j=0; j<N; j++)
			if (j!=i) {
				x1 = (lang[i].z*lang[j].x2-lang[j].z*lang[i].x1) / (lang[i].z-lang[j].z);
				x2 = (lang[i].z*lang[j].x1-lang[j].z*lang[i].x2) / (lang[i].z-lang[j].z);
				if (x1>x2) {tmp = x1; x1 = x2; x2 = tmp; }
				if (x1>max) max = x1;
				if (x2<min) min = x2;
			}
	if (min<max) {
		fprintf(f, "UNSOLVABLE");
		return 0;
	}
	shPX = (min+max)/2;
	min = 1000000000.0;
	max = -1000000000.0;
	for (i=0; i<N; i++) {
		x1 = (lang[i].x1-shPX)/lang[i].z;
		x2 = (lang[i].x2-shPX)/lang[i].z;
		if (x1>max) max = x1;
		if (x2<min) min = x2;
	}
	if (min<max) {
		fprintf(f, "UNSOLVABLE");
		return 0;
	}
	shX = (min+max)/2;
	fprintf(f,"SOLUTION\n%.6f\n", (float)shPX);
	for (i=0; i<N; i++) {
		fprintf(f, "%.6f %.6f %.6f\n", float(shX*lang[i].z+shPX), float(shY*lang[i].z), float(lang[i].z));
	}
	return 0;
}
