program pg; {$n+}

const infile  = 'gunman.in';
      outfile = 'gunman.out';
      maxn    = 100;
      eps     = 1e-10;

//type tpoint   = record x, y, z : extended end;

var n : longint;
    k, x, y, z, xmin,ymin,xmax,ymax:array[1..maxn] of extended;
    ylast : extended;
//    w : array[1..maxn, 1..2]of tpoint;

procedure ok(x0:extended);
var i:integer;
begin
  writeln('SOLUTION');
  writeln(x0:0:6);
  for i:=1 to n do writeln(x[i]:0:6, ' ', y[i]:0:6, ' ', z[i]:0:6);
  close(output);
  halt(0);
end;

procedure nosol;
begin
  writeln('UNSOLVABLE');
  close(output);
  halt(0);
end;

procedure init;
var i : longint;
 begin
  assign(input, infile); reset(input);
  assign(output, outfile); rewrite(output);
  read(n);
  for i := 1 to n do begin
//    read(w[i, 1].x, w[i, 1].y, w[i, 2].x, w[i, 2].y, w[i, 1].z);
 //   w[i, 2].z := w[i, 1].z;
    read(xmin[i], ymin[i], xmax[i], ymax[i]);
    read(z[i]);
   end;
 end;

procedure testline(x1, x2, z1, z2 : extended);
var k, b: extended;
    i:integer;
 begin
   k := (x1-x2)/(z1-z2);
   b := x1 - k*z1;
   for i:=1 to n do begin
      x[i] := k*z[i] + b;
      if not(  (xmin[i]<x[i]+eps) and (x[i]<xmax[i]+eps) ) then exit;
     end;

  ok(b);
 end;



procedure solve;
var yl,yr,ymin0,ymax0 : extended;
    i,j :integer;
 begin
   for i:=1 to n do k[i]:=z[n]/z[i];
   ymin0 := ymin[1]*k[1];
   ymax0 := ymax[1]*k[1];
   for i:=2 to n do begin
       yr := ymax[i]*k[i];
       yl := ymin[i]*k[i];
       if yl>ymax0 then nosol;
       if yr<ymin0 then nosol;

       if yl>ymin0 then ymin0:=yl;
       if yr<ymax0 then ymax0:=yr;
     end;

   if ymin0 < ymax0+eps then begin
      ylast := (ymin0+ymax0)/2;
      for i:=1 to n do y[i]:= ylast / z[n] * z[i];

      for i:=1 to n-1 do
        for j:=i+1 to n do begin
            testline(xmin[i], xmax[j], z[i], z[j]);
            testline(xmax[i], xmin[j], z[i], z[j]);
            testline(xmax[i], xmax[j], z[i], z[j]);
            testline(xmin[i], xmin[j], z[i], z[j]);
          end;
      nosol;
     end else nosol;





 end;

procedure save;
 begin
  close(output);
 end;

begin
 init;
 solve;
 save;
end.
