{$APPTYPE CONSOLE}
{$I-,S-,Q-,R-,D-,L-,Y-,P-}
const
  maxN = 100;

var
  i, n : longint;
  outx,outy,x1, y1, x2, y2, z : array [1..maxN] of extended;
  ok:boolean;
  napx,napy,solx:extended;

function intery(yy:extended;i:longint):boolean;
var yy2:extended;
begin
  yy2:=yy*z[i];
  intery:=(yy2>=y1[i])and(yy2<=y2[i]);
end;

function checky(yy,zz:extended):boolean;
var i:longint;
begin
  checky:=false;
  for i:=1 to n do
    if not intery(yy/zz,i) then
      exit;
  checky:=true;
  napy:=yy/zz;
end;

procedure run1;
var i:longint;
begin
  for i:=1 to n do
    begin
      if checky(y1[i],z[i]) then
        exit;
      if checky(y2[i],z[i]) then
        exit;
    end;
  ok:=false;
end;

function interx(xx1,zz1,xx2,zz2:extended;i:longint):boolean;
var xx:extended;
begin
  xx:=xx1+(xx2-xx1)*(zz1-z[i])/(zz1-zz2);
  interx:=(xx>=x1[i])and(xx<=x2[i]);
end;

function checkx(xx1,zz1,xx2,zz2:extended):boolean;
var i:longint;
begin   
  checkx:=false;
  for i:=1 to n do
    if not interx(xx1,zz1,xx2,zz2,i) then
      exit;
  checkx:=true;
  solx:=xx1+(xx2-xx1)*zz1/(zz1-zz2);
  napx:=xx1+(xx2-xx1)*(zz1-1)/(zz1-zz2)-solx;
end;

procedure run2;
var i,j:longint;
begin
  for i:=n downto 2 do
    for j:=i-1 downto 1 do
      begin
        if checkx(x1[i],z[i],x1[j],z[j]) then
          exit;
        if checkx(x2[i],z[i],x1[j],z[j]) then
          exit;
        if checkx(x1[i],z[i],x2[j],z[j]) then
          exit;
        if checkx(x2[i],z[i],x2[j],z[j]) then
          exit;
      end;
  ok:=false;
end;

procedure getout;
var i:longint;
begin
  for i:=1 to n do
    begin
      outy[i]:=z[i]*napy;
      outx[i]:=solx+z[i]*napx;
    end;
end;

procedure run;
begin
  ok:=true;
  run1;
  if ok then
    run2;
  if ok then
    getout;
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]);

  run;

  if ok then
    begin
      writeln('SOLUTION');
      writeln(solx:0:6);
      for i:=1 to n do
        writeln(outx[i]:0:6,' ',outy[i]:0:6,' ',z[i]:0:6);
    end
  else
    write('UNSOLVABLE');

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