program taskg;
{$APPTYPE CONSOLE}
{$I+,Q+,R+,O-}
{ $I-,Q-,R-,O+}
uses
  SysUtils,Math;
type
  short=smallint;
  long=longint;
  ex=extended;
  bool=boolean;
const
  maxn=100;
  eps=1e-15;
var
  a,xs,z,x1,x2:array[1..maxn]of ex;
  n:short;

  function le(a,b:ex):bool;
  begin
    le:=(a-b<eps);
  end;

  function dosolve1(var xi:ex; can:bool):bool;
  var
    dz,ax1,ax2,az1:ex;
    dd,dx,x:ex;
    function do2:bool;
    var
      i:short;
    begin
      do2:=false;
      dx:=ax2-ax1;
      dd:=dx/dz;

      xi:=(0-az1)*dd+ax1;
      if not can and (abs(xi)>eps) then exit;
      i:=1;
      while (i<=n) do begin
        x:=(z[i]-az1)*dd+ax1;
        if le(x1[i],x) and le(x,x2[i]) then
        else exit;
        xs[i]:=x;
        inc(i);
      end;
      do2:=true;
    end;

    function do1(i:short):bool;
    var j:short;
    begin
      do1:=true;
      for j:=i+1 to n do begin
        dz:=z[j]-az1;
        ax2:=x1[j];
        if do2 then exit;
        ax2:=x2[j];
        if do2 then exit;
      end;
      do1:=false;
    end;

  var
    i:short;
  begin
    dosolve1:=true;
    for i:=1 to n-1 do begin
      az1:=z[i];
      ax1:=x1[i];
      if do1(i) then exit;
      ax1:=x2[i];
      if do1(i) then exit;
    end;
    dosolve1:=false;
  end;

  procedure o(x:ex);
  var s:string[40];
  begin
    str(x:0:6,s);
    if s='-0.000000' then delete(s,1,1);
    write(s);
  end;

var
  x1i,x2i,y1i,y2i,zi:array[1..maxn]of ex;
  
  procedure dosolve;
  var
    i:short;
    xx,yy:ex;
  begin
    for i:=1 to n do begin
      x1[i]:=x1i[i];
      x2[i]:=x2i[i];
      z[i]:=zi[i];
    end;

    if dosolve1(xx,true) then begin
      a:=xs;

      for i:=1 to n do begin
        x1[i]:=y1i[i];
        x2[i]:=y2i[i];
        z[i]:=zi[i];
      end;
      if dosolve1(yy,false) then begin
        writeln('SOLVABLE');
        o(xx);
        writeln;
        for i:=1 to n do begin
          o(a[i]);
          write(' ');
          o(xs[i]);
          write(' ');
          o(z[i]);
          writeln;
        end;
        exit;
      end;
    end;
    writeln('UNSOLVABLE');
  end;

var
  i:short;
begin
  assign(input,'gunman.in'); reset(input);
  assign(output,'gunman.out'); rewrite(output);

  read(n);
  for i:=1 to n do read(x1i[i],y1i[i],x2i[i],y2i[i],zi[i]);
  dosolve;

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

