const eps=1e-15;
      inf=1e60;
type tarr=array[1..100] of int64;
var x1,y1,x2,y2,z:tarr;
    c,minx,maxx,miny,maxy,x0,kxmin,kxmax,kymin,kymax,kx,ky:double;
    n,i:integer;

function solvemin(var x1,x2,z:tarr):double;
var i,j:integer;
    c,m:double;
begin
 m:=-inf;
 for i:=1 to n-1 do for j:=i+1 to n do begin
  c:=(x1[i]*z[j]-x2[j]*z[i])/(z[j]-z[i]);
  if c>m then m:=c;
 end;
 result:=m;
end;

function solvemax(var x1,x2,z:tarr):double;
var i,j:integer;
    c,m:double;
begin
 m:=inf;
 for i:=1 to n-1 do for j:=i+1 to n do begin
  c:=(x2[i]*z[j]-x1[j]*z[i])/(z[j]-z[i]);
  if c<m then m:=c;
 end;
 result:=m;
end;

procedure quit;
begin
 writeln('UNSOLVABLE');
 close(output);
 close(input);
 halt(0);
end;


begin
 assign(input,'gunman.in'); reset(input);
 assign(output,'gunman.out'); rewrite(output);
 read(n);
 for i:=1 to n do read(x1[i],y1[i],x2[i],y2[i],z[i]);
 minx:=solvemin(x1,x2,z);
 maxx:=solvemax(x1,x2,z);
 miny:=solvemin(y1,y2,z);
 maxy:=solvemax(y1,y2,z);
 if (miny>0+eps) or (maxy<0-eps) then quit;
 if (minx>maxx+eps) then quit;
 x0:=(minx+maxx)/2;
 kxmax:=inf;
 kxmin:=-inf;
 kymax:=inf;
 kymin:=-inf;
 for i:=1 to n do begin
  c:=(x2[i]-x0)/z[i];
  if c<kxmax then kxmax:=c;
  c:=(x1[i]-x0)/z[i];
  if c>kxmin then kxmin:=c;
  c:=(y2[i]-0)/z[i];
  if c<kymax then kymax:=c;
  c:=(y1[i]-0)/z[i];
  if c>kymin then kymin:=c;
 end;
 kx:=(kxmax+kxmin)/2;
 ky:=(kymax+kymin)/2;
 writeln('SOLUTION');
 writeln(x0:0:6);
 for i:=1 to n do writeln(x0+kx*z[i]:0:6,' ',ky*z[i]:0:6,' ',(z[i]+0.0):0:6);
 close(output);
 close(input);
end.