program xx;
const inp='gunman.in';
     outp='gunman.out';
     eps=1e-8;
var i,j,n:longint;
    f:boolean;
    xp,yp,x1,y1,x2,y2,z:array[1..100]of double;
    xx0:double;

procedure checkx(xx,z1,x,zz,y:double);
var dt,x0,t1,t2,k,l,m:double;
    ii:longint;
begin
 if f then exit;
 dt:=zz/z1;
 x0:=(dt*xx-x)/(dt-1);
 if abs(xx-x0)> eps then
 Begin
 t1:=xx-x0;
 t2:=dt*t1;
 l:=y/t2;
 m:=z1/t1;
 for ii:=1 to n+1 do
  if ii=n+1 then begin f:=true; exit; end else
  begin
   xp[ii]:=x0+z[ii]/m;
   yp[ii]:=l*z[ii]/m;
   if (xp[ii]<x1[ii]-eps)or(xp[ii]>x2[ii]+eps)or
      (yp[ii]<y1[ii]-eps)or(yp[ii]>y2[ii]+eps) then
      exit else xx0:=x0;
   end;
 End else
 begin
 l:=y/zz;
 for ii:=1 to n+1 do
  if ii=n+1 then begin f:=true; exit; end else
  begin
   xp[ii]:=x0;
   yp[ii]:=l*z[ii];
   if (xp[ii]<x1[ii]-eps)or(xp[ii]>x2[ii]+eps)or
      (yp[ii]<y1[ii]-eps)or(yp[ii]>y2[ii]+eps) then
      exit else xx0:=x0;
    end;
 end;

end;

begin
 assign(input,inp); reset(input);
 assign(output,outp); rewrite(output);
 read(n);
 f:=false;
 for i:=1 to n do read(x1[i],y1[i],x2[i],y2[i],z[i]);
 for i:=1 to n do
  for j:=1 to n do
   if (i<>j)and(not f) then
    begin
     checkx(x1[i],z[i],x1[j],z[j],y1[j]);
     checkx(x1[i],z[i],x2[j],z[j],y1[j]);
     checkx(x2[i],z[i],x1[j],z[j],y1[j]);
     checkx(x2[i],z[i],x2[j],z[j],y1[j]);
     checkx(x1[i],z[i],x1[j],z[j],y2[j]);
     checkx(x1[i],z[i],x2[j],z[j],y2[j]);
     checkx(x2[i],z[i],x1[j],z[j],y2[j]);
     checkx(x2[i],z[i],x2[j],z[j],y2[j]);
    end;
 if f then
  begin
   writeln('SOLUTION');
   writeln(xx0:0:6);
   for i:=1 to n do
    writeln(xp[i]:0:6,' ',yp[i]:0:6,' ',z[i]:0:6);
  end else
 writeln('UNSOLVABLE'); 

 close(input); close(output);
end.
