var
 fin,fout:textfile;
 i,j,n:longint;
 xx1,yy1,xx2,yy2,zz:array[1..100] of extended;
 vx,vy,x0:extended;
 x1,y1,x2,y2,z:extended;
 sl:boolean;
 qx,qy,qz:extended;
label tfin;
function test:boolean;
var tx,ty:extended;
    ii:longint;
    yes:boolean;
label nfin;
begin
 yes:=true;
 for ii:=1 to n do begin
  tx:=x0+vx*zz[ii];
  ty:=vy*zz[ii];
  if (tx+0.000001<xx1[ii])or(tx-0.000001>xx2[ii])or(ty+0.000001<yy1[ii])or(ty-0.000001>yy2[ii]) then begin
   yes:=false;
   goto nfin;
  end;
 end;
 nfin:;
 test:=yes;
end;

begin
 assignfile(fin,'gunman.in');
 assignfile(fout,'gunman.out');
 reset(fin);
 rewrite(fout);
 readln(fin,n);
 sl:=false;
 for i:=1 to n do begin
  readln(fin,x1,y1,x2,y2,z);
  xx1[i]:=x1;
  yy1[i]:=y1;
  xx2[i]:=x2;
  yy2[i]:=y2;
  zz[i]:=z;
 end;
 for i:=1 to n do for j:=1 to n do if i<>j then begin
  vx:=(xx1[i]-xx1[j])/(zz[i]-zz[j]);
  x0:=xx1[i]-vx*zz[i];
  vy:=yy1[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;

  vx:=(xx1[i]-xx2[j])/(zz[i]-zz[j]);
  x0:=xx1[i]-vx*zz[i];
  vy:=yy1[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;

  vx:=(xx2[i]-xx1[j])/(zz[i]-zz[j]);
  x0:=xx2[i]-vx*zz[i];
  vy:=yy1[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;

  vx:=(xx2[i]-xx2[j])/(zz[i]-zz[j]);
  x0:=xx2[i]-vx*zz[i];
  vy:=yy1[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;

  vx:=(xx1[i]-xx1[j])/(zz[i]-zz[j]);
  x0:=xx1[i]-vx*zz[i];
  vy:=yy2[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;

  vx:=(xx1[i]-xx2[j])/(zz[i]-zz[j]);
  x0:=xx1[i]-vx*zz[i];
  vy:=yy2[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;

  vx:=(xx2[i]-xx1[j])/(zz[i]-zz[j]);
  x0:=xx2[i]-vx*zz[i];
  vy:=yy2[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;  

  vx:=(xx2[i]-xx2[j])/(zz[i]-zz[j]);
  x0:=xx2[i]-vx*zz[i];
  vy:=yy2[i]/zz[i];
  if test=true then begin
   sl:=true;
   goto tfin;
  end;
 end;

 tfin:;
 if sl then begin
  writeln(fout,'SOLUTION');
  writeln(fout,x0:6:6);
  for i:=1 to n do begin
   qx:=x0+vx*zz[i];
   qy:=vy*zz[i];
   qz:=zz[i];
   writeln(fout,qx:6:6,' ',qy:6:6,' ',qz:6:6);
  end;
 end else begin
  writeln(fout,'UNSOLVABLE')
 end;

 closefile(fin);
 closefile(fout);
end.