{$DEFINE DMI}
{$DEFINE DO0}
{$DEFINE DEBUG}
{$IFDEF DEBUG}
{$B-,I+,N+,O-,Q+,R+,S+}
{$ELSE}
{$B-,I-,N+,O+,Q-,R-,S-}
{$ENDIF}
{$APPTYPE CONSOLE}
Program OlympSol;
uses Math,SysUtils;
const
e=0.00000001;

var q,l,i,ii,j,jj,n,p:integer;
o,xk,x1,x2,y1,y2:extended;
x,y:array[1..2,1..200] of int64;
z:array[1..200] of int64;
xo,yo:array[1..200] of extended;

BEGIN
 assign (input, 'gunman.in'); reset (input);
 assign (output,'gunman.out'); rewrite (output);
 read(n);
 for i:=1 to n do
 read(x[1,i],y[1,i],x[2,i],y[2,i],z[i]);
y1:=y[1,1];
y2:=y[2,1];
for i:=2 to n do begin
y1:=max(y[1,i],(z[i]/z[i-1])*y1);
y2:=min(y[2,i],(z[i]/z[i-1])*y2);
end;
if y1>y2+e then writeln('UNSOLVABLE') else
begin
yo[n]:=y1;
for i:=1 to n-1 do yo[i]:=yo[n]*(z[i]/z[n]);
q:=0;
for i:=1 to n do
for ii:=1 to 2 do
for j:=i+1 to n do
for jj:=1 to 2 do
begin
p:=1;
for l:=1 to n do if
((x[1,l]-x[ii,i])*(z[j]-z[i])-(x[jj,j]-x[ii,i])*(z[l]-z[i]))*
((x[2,l]-x[ii,i])*(z[j]-z[i])-(x[jj,j]-x[ii,i])*(z[l]-z[i]))>0 then p:=0;
if p=1 then begin
x1:=x[ii,i];
y1:=z[i];
x2:=x[jj,j];
y2:=z[j];
q:=1;
end;
end;
if q=0 then writeln('UNSOLVABLE')
else begin
for i:=1 to n do begin
o:=(z[i]-y2)/(y1-y2);
xo[i]:=o*x1+(1-o)*x2;
end;
o:=y2/(y2-y1);
xk:=o*x1+(1-o)*x2;
writeln('SOLUTION');
writeln(xk:0:6);
for i:=1 to n do
writeln(xo[i]:0:6,' ',yo[i]:0:6,' ',z[i],'.000000');
end;
end;
END.
