{$APPTYPE CONSOLE}
{$O-,R+,Q+}
uses
  Sysutils, Math;
const
  inf = 1000000000;
  eps = 1e-9;
  base = 10;
type
  int = longint;
  bool = boolean;
  real = extended;
  p3 = record
    x, y, z: real;
  end;

var
  cnt, i, j, k, n, m: int;
  p1, p2: array[1..100] of p3;
  maxda, minua: real;
  a: real;
  h: array[1..100] of real;
  z, x: array[1..100, 1..2] of real;
  ans, xx, k1, b1: real;
  p, q: int;
  
begin
  assign(input, 'gunman.in');
  reset(input);
  assign(output, 'gunman.out');
  rewrite(output);

  read(n);
  for i := 1 to n do
  begin
    read(p1[i].x, p1[i].y, p2[i].x, p2[i].y, p1[i].z);
    p2[i].z := p1[i].z;
  end;

  maxda := -1;
  minua := inf;
  
  for i := 1 to n do
  begin
    a := arctan2(p1[i].y, p1[i].z);
    if a > maxda then maxda := a;
    a := arctan2(p2[i].y, p2[i].z);
    if a < minua then minua := a;
  end;

  if maxda > minua then
  begin
    writeln('UNSOLVABLE');
    halt(0);
  end;

  a := maxda;

  for i := 1 to n do
  begin
    x[i][1] := p1[i].x;
    z[i][1] := p1[i].z / cos(a);
    x[i][2] := p2[i].x;
    z[i][2] := p2[i].z / cos(a);
    h[i] := p1[i].z * tan(a);
  end;

  for i := 1 to n - 1 do
  begin
    for j := i + 1 to n do
    begin
      for p := 1 to 2 do
      begin
        for q := 1 to 2 do
        begin
          cnt := 0;
          if abs(x[j][q] - x[i][p]) > eps then
          begin
            k1 := (z[i][p] - z[j][q]) / (x[i][p] - x[j][q]);
            b1 := -(k1 * x[i][p] - z[i][p]);
            for k := 1 to n do
            begin
              xx := (z[k][1] - b1) / k1;
              if (xx >= x[k][1]) and (xx <= x[k][2]) then
              begin
                inc(cnt);
              end
            end;
            if cnt = n then
            begin
              writeln('SOLUTION');
              ans := -b1/k1;
              if abs(ans) < eps then ans := 0;
              writeln(ans :0:6);
              for k := 1 to n do
              begin
                xx := (z[k][1] - b1) / k1;
                writeln(xx:0:6, ' ', h[k]:0:6, ' ', p1[k].z:0:6);
              end;
              halt(0);
            end;
          end
          else begin
            cnt := 0;
            for k := 1 to n do
            begin
              xx := x[i][p];
              if (xx >= x[k][1]) and (xx <= x[k][2]) then
              begin
                inc(cnt);
              end
            end;
            if cnt = n then
            begin
              writeln('SOLUTION');
              ans := x[i][p];
              if abs(ans) < eps then ans := 0;
              writeln(ans :0:6);
              for k := 1 to n do
              begin
                xx := x[i][p];
                writeln(xx:0:6, ' ', h[k]:0:6, ' ', p1[k].z:0:6);
              end;
              halt(0);
            end;
          end;
        end;
      end;
    end;
  end;
  writeln('UNSOLVABLE');
  close(input);
  close(output);
end.
//Leafy tops of root vegetables strike back...