{$APPTYPE CONSOLE}
const
  eps = 1e-15;
var
  x1,y1,x2,y2,z:array[1..100]of extended;
  ok:array[1..4]of boolean;
  okmain:boolean;
  i,j,k,n:longint;
  x002,z001,z002,x,y,x01,y01,z01,x02,y02,z02,xg,xp,xp1:extended;

function check(x1,y1,x2,y2,xl,xr,y:extended):boolean;
var
  x:extended;
begin
  x:=x1+(x2-x1)/(y2-y1)*(y-y1);
  if (x>xl-eps)and(x<xr+eps) then check:=true else check:=false;
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]);
  okmain:=false;
  for i:=1 to n-1 do
    for j:=i+1 to n do begin
      for k:=1 to 4 do ok[k]:=true;
      for k:=1 to n do begin
        ok[1]:=ok[1]and check(x1[i],z[i],x1[j],z[j],x1[k],x2[k],z[k]);
        ok[2]:=ok[2]and check(x1[i],z[i],x2[j],z[j],x1[k],x2[k],z[k]);
        ok[3]:=ok[3]and check(x2[i],z[i],x1[j],z[j],x1[k],x2[k],z[k]);
        ok[4]:=ok[4]and check(x2[i],z[i],x2[j],z[j],x1[k],x2[k],z[k]);
      end;
      if ok[1] then begin
        okmain:=true; x01:=x1[i]; z01:=z[i]; x02:=x1[j]; z02:=z[j];
        break;
      end;
      if ok[2] then begin
        okmain:=true; x01:=x1[i]; z01:=z[i]; x02:=x2[j]; z02:=z[j];
        break;
      end;
      if ok[3] then begin
        okmain:=true; x01:=x2[i]; z01:=z[i]; x02:=x1[j]; z02:=z[j];
        break;
      end;
      if ok[4] then begin
        okmain:=true; x01:=x2[i]; z01:=z[i]; x02:=x2[j]; z02:=z[j];
        break;
      end;
  end;
  if not okmain then begin
    write('UNSOLVABLE'); exit;
  end;
  xg:=x01-z01*(x02-x01)/(z02-z01);
  okmain:=false;
  for i:=1 to n do begin
    ok[1]:=true; ok[2]:=true;
    xp1:=x01+(x02-x01)/(z02-z01)*(z[i]-z01);
    for k:=1 to n do begin
      xp:=x01+(x02-x01)/(z02-z01)*(z[k]-z01);
      ok[1]:=ok[1]and check(0,0,y1[i],sqrt(sqr(z[i])+sqr(xg-xp1)),y1[k],y2[k],sqrt(sqr(z[k])+sqr(xg-xp)));
      ok[2]:=ok[2]and check(0,0,y2[i],sqrt(sqr(z[i])+sqr(xg-xp1)),y1[k],y2[k],sqrt(sqr(z[k])+sqr(xg-xp)));
    end;
    if ok[1] then begin
      okmain:=true; y01:=0; z001:=0; y02:=y1[i]; x002:=xp1; z002:=z[i];break;
    end;
    if ok[1] then begin
      okmain:=true; y01:=0; z001:=0; y02:=y2[i]; x002:=xp1; z002:=z[i];break; 
    end;
  end;
  if not okmain then begin
    write('UNSOLVABLE'); exit;
  end;
  writeln('SOLUTION');
  writeln(xg:0:6);
  y01:=0; z01:=0; x01:=xg; z02:=z002; x02:=x002;
  for k:=1 to n do begin
    x:=x01+(x02-x01)/(z02-z01)*(z[k]-z01);
    y:=y01+(y02-y01)/(z02-z01)*(z[k]-z01);
    writeln(x:0:6,' ',y:0:6,' ',z[k]:0:6);
  end;
end.
 