program g;

{$APPTYPE CONSOLE}

const fname = 'gunman';
      ifile = fname + '.in';
      ofile = fname + '.out';
      MAXN = 200;

var n: longint;
    mas: array[1..MAXN,1..5]of longint;

procedure load();
var k,l: longint;
begin
  read(n);
  for k:=1 to n do
    for l:=1 to 5 do
      read(mas[k,l]);
end;

procedure solve();
var k,l,kk: longint;
    q,xc,yc,zc,x,x1,x2,ya,xmin,xmax: extended;
begin
  for k:=1 to n do 
    for l:=0 to 3 do begin
      xc:=mas[k,2*(l and 1)+1];
      yc:=mas[k,2*(l shr 1)+2];
      zc:=mas[k,5];
      xmin:=-1E100;
      xmax:=1E100;
      for kk:=1 to n do
        if (kk<>k) then begin
          ya:=yc*mas[kk,5]/zc;
          if (ya>=mas[kk,2])and(ya<=mas[kk,4]) then begin
            x1:=(xc*mas[kk,5]-mas[kk,1]*zc)/(mas[kk,5]-zc);
            x2:=(xc*mas[kk,5]-mas[kk,3]*zc)/(mas[kk,5]-zc);
            if x1>x2 then begin
              q:=x1;
              x1:=x2;
              x2:=q;
            end;
            if x1>xmin then xmin:=x1;
            if x2<xmax then xmax:=x2;
          end
          else begin
            xmin:=1;
            xmax:=-1;
            break;
          end;
        end;
      if xmin<=xmax then begin
        x:=(xmin+xmax)/2;
        writeln('SOLUTION');
        writeln(x:0:6);
        for kk:=1 to n do
          if kk=k then
            writeln(xc:0:6,' ',yc:0:6,' ',zc:0:6)
          else begin
            ya:=yc*mas[kk,5]/zc;
            writeln((mas[kk,5]*(xc-x)/zc+x):0:6,' ',ya:0:6,' ',mas[kk,5],'.000000');
          end;
        exit;
      end;
    end;
  writeln('UNSOLVABLE');
end;

procedure save();
begin

end;

begin
  assign(input,ifile);
  reset(input);
  assign(output,ofile);
  rewrite(output);
  load;
  solve;
  save;
end.
