{$R+,Q+,O+}
{$MINSTACKSIZE $00404000}
{$APPTYPE CONSOLE}
type
  int = longint;
  tline = record
    a, b, c: extended;
  end;

const
  maxn = 110;
  eps = 1e-8;

var
  i, j, k, n: int;
  x1, y1, x2, y2, z: array[1..maxn] of int;
  min, max, cur, dy: extended;
  flag: boolean;
  xx: array[1..maxn] of extended;
  x0: extended;
  l: tline;

procedure nosol;
begin
  write('UNSOLVABLE');
  halt(0);
end;

procedure makeline(x1, y1, x2, y2: longint; var l: tline);
begin
  l.a := y2 - y1;
  l.b := x1 - x2;
  l.c := -(l.a * x1 + l.b * y1);
end;

function perline(l: tline; z: longint): extended;
begin
  perline := -(l.b * z + l.c) / l.a;

end;

begin
  assign(input, 'gunman.in');
  assign(output, 'gunman.out');
  reset(input);
  rewrite(output);

  read(n);

  for i := 1 to n do begin
    read(x1[i], y1[i], x2[i], y2[i], z[i]);
  end;


  max := y1[1]/z[1];
  min := y2[1]/z[1];

  for i := 2 to n do begin
    cur := y1[i]/z[i];
    if max < cur then
      max := cur;
    cur := y2[i]/z[i];
    if min > cur then
      min := cur;
  end;
  if min + eps < max then
    nosol;

  dy := (min + max) / 2;

  for i := 1 to n do
    for j := 1 to n do
      if (i <> j) then begin
        makeline(x1[i], z[i], x2[j], z[j], l);
        flag := true;
        for k := 1 to n do begin
          xx[k] := perline(l, z[k]);
          if not ((xx[k] + eps > x1[k]) and (x2[k] + eps > xx[k])) then begin
            flag := false;
            break;
          end; 
        end;
        if flag then begin
          x0 := perline(l, 0);
          writeln('SOLUTION');
          writeln(x0:0:7);
          for k := 1 to n do begin
            writeln(xx[k]:0:7, ' ', dy * z[k]:0:7, ' ', z[k]);
          end;
          halt(0);
        end;
      end;

  nosol;

end.
