program ProbG;
const
	MAXN = 1000;
  INF = 1e+100;
  
type
	TWindow = record
  	x1, y1, x2, y2, z: Integer;
  end;

var
	n: Integer;
  w: array[1..MAXN] of TWindow;

procedure InputData;
var
	i: Integer;
begin
	Readln(n);
  for i:=1 to n do
    with w[i] do
  		Readln(x1, y1, x2, y2, z);
end;

function VertA(var va: Extended): Boolean;
var
	a, minA, maxA: Extended;
  i: Integer;
begin
	minA := INF;
	maxA := -INF;
  for i:=1 to n do
  begin
  	a := w[i].y2 / w[i].z;
    if a < minA then
    	minA := a;
  	a := w[i].y1 / w[i].z;
    if a > maxA then
    	maxA := a;
  end;
  va := minA;
  result := minA >= maxA;
end;

function GunAngle(x1, z1, x2, z2: Extended): Extended;
begin
	result := (x2 - x1) / (z2 - z1);
end;


function HorA(var va, xx: Extended): Boolean;
var
	i, j : Integer;
	ga, minA, maxA: Extended;
  bx, bz: Integer;
begin
	for i:=1 to n do
  begin
    minA := -INF;
    maxA := +INF;
    bx := -1;
    bz := -1;
  	for j := 1 to N do
    	if i <> j then
      begin
        ga := GunAngle(w[i].x1, w[i].z, w[j].x1, w[j].z);
        if ga > minA then
        begin
        	minA := ga;
          bx := w[i].x1;
          bz := w[i].z;
        end;
        ga := GunAngle(w[i].x1, w[i].z, w[j].x2, w[j].z);
        if ga < maxA then
        	maxA := ga;
      end;
    if minA >= maxA then
    begin
      va := minA;
      xx := bx - bz * va;
      result := True;
      Exit;
    end;
    minA := -INF;
    maxA := +INF;
  	for j := 1 to N do
    	if i <> j then
      begin
        ga := GunAngle(w[i].x2, w[i].z, w[j].x1, w[j].z);
        if ga > minA then
        begin
        	minA := ga;
          bx := w[i].x2;
          bz := w[i].z;
        end;
        ga := GunAngle(w[i].x2, w[i].z, w[j].x2, w[j].z);
        if ga < maxA then
        	maxA := ga;
      end;
    if minA <= maxA then
    begin
      va := minA;
      xx := bx - bz * va;
      result := True;
      Exit;
    end
  end;
  result := False;
end;

function Solve: Boolean;
var
	va, ha, xx: Extended;
  i: Integer;
begin
  Solve := False;
	if not VertA(va) then
  	Exit;
	if not HorA(ha, xx) then
  	Exit;
  Writeln('SOLUTION');
  Writeln(xx:0:6);
  for i:=1 to n do
  	Writeln(xx + w[i].z*ha:0:6, ' ', w[i].z*va:0:6, ' ', w[i].z:0, '.000000');
  Solve := True
end;

begin
	Reset(input, 'gunman.in');
	Rewrite(output, 'gunman.out');
  InputData;
  if not Solve then
  	Writeln('UNSOLVABLE');
  Close(output);
end.
