{$APPTYPE CONSOLE}
const maxn=202;
      eps=1e-9;
type realnum=extended;
     line=record
      a,b,c:realnum;
     end;
var ans1,ans2,n:longint;
    px,py,x,y,x1,y1,x2,y2,z:array[1..maxn] of realnum;
    xx:realnum;

procedure readdata;
var i:longint;
begin
 read(n);
 for i:=1 to n do
 begin
  read(x1[i],y1[i],x2[i],y2[i],z[i]);
  x[i]:=x1[i];
  y[i]:=y1[i];
  x[n+i]:=x2[i];
  y[n+i]:=y2[i];
  z[n+i]:=z[i];
 end;
end;

procedure getline(x1,y1,x2,y2:realnum;var l:line);
begin
 with l do
 begin
  a:=y2-y1;
  b:=x1-x2;
  c:=-(x1*a+y1*b);
 end;
end;

function bet(a,b,c:realnum):boolean;
begin
 bet:=(a-eps<=b) and (b-eps<=c);
end;

procedure solve1;
var ok,k,i,j:longint;
    l:line;
begin
 ans1:=1;
 for i:=1 to 2*n do
 for j:=i+1 to 2*n do
 if z[i]<>z[j] then
 begin
  getline(x[i],z[i],x[j],z[j],l);
  ok:=1;
  for k:=1 to n do
  begin
   px[k]:=-(l.b*z[k]+l.c)/l.a;
   if not bet(x1[k],px[k],x2[k]) then
   begin
    ok:=0;
    break;
   end;
  end;
  if ok=1 then
   begin
    xx:=-l.c/l.a;
    exit;
   end;
 end;
 ans1:=0;
end;

procedure solve2;
var i,k,ok:longint;
    l:line;
begin
 ans2:=1;
 for i:=1 to 2*n do
 begin
  getline(0,0,y[i],z[i],l);
  ok:=1;
  for k:=1 to n do
  begin
   py[k]:=-(l.b*z[k]+l.c)/l.a;
   if not bet(y1[k],py[k],y2[k]) then
   begin
    ok:=0;
    break;
   end;
  end;
  if ok=1 then
   exit;
 end;
 ans2:=0;
end;

procedure outdata;
var i:longint;
begin
 if (ans1=1) and (ans2=1) then
 begin
  writeln('SOLUTION');
  writeln(xx:0:6);
  for i:=1 to n do
  writeln(px[i]:0:6,' ',py[i]:0:6,' ',z[i]:0:6);
  exit;
 end;
 writeln('UNSOLVABLE');
end;

begin
 assign(input,'gunman.in');
 reset(input);
 assign(output,'gunman.out');
 rewrite(output);
 readdata;
 solve1;
 solve2;
 outdata;
 close(output);
end.
