{$APPTYPE CONSOLE}
{$O-,Q+,R+}

uses Math, SysUtils;

type
  int = integer;
  bool = boolean;
  real = extended;

var
  n: integer;
  i, j: integer;
  ii: integer;
  x1, x2, y1, y2, z: array[1..100] of real;
  aa: array[1..200] of real;
  cc: array[1..200] of integer;
  fl: boolean;
  xx, a, b: real;
  an: real;
  m: integer;

procedure no;
begin
  writeln('UNSOLVABLE');
  halt;
end;

procedure sort(l, r: integer);
var
  i, j: integer;
  x, t: real;
  tt: integer;
begin
  i := l;
  j := r;
  x := aa[l + random(r - l + 1)];
  while i <= j do begin
    while aa[i] < x do inc(i);
    while aa[j] > x do dec(j);
    if i <= j then begin
      t := aa[i];
      aa[i] := aa[j];
      aa[j] := t;
      tt := cc[i];
      cc[i] := cc[j];
      cc[j] := tt;
      inc(i);
      dec(j);
    end;
  end;
  if i < r then sort(i, r);
  if l < j then sort(l, j);
end;

const
  eps = 1e-10;

var
  q: integer;

begin
  reset(input, 'gunman.in');
  rewrite(output, 'gunman.out');
  read(n);
  for i := 1 to n do begin
    read(x1[i], y1[i], x2[i], y2[i], z[i]);
  end;

  for i := 1 to n do if not fl then begin
    for j := i + 1 to n do if not fl then begin
      a := (x1[i] - x2[j]) / (z[i] - z[j]);
      b := x1[i] - a * z[i];

      fl := true;
      for ii := 1 to n do begin
        xx := z[ii] * a + b;
        if (xx < x1[ii] - eps) or (xx > x2[ii] + eps) then fl := false;
      end;

    end;
  end;

  if not fl then NO;

  m := 0;
  for i := 1 to n do begin
    inc(m);
    aa[m] := y1[i] / z[i];
    cc[m] := 1;
    inc(m);
    aa[m] := y2[i] / z[i] + eps;
    cc[m] := -1;
  end;

  sort(1, m);

  fl := false;
  q := 0;
  for i := 1 to m do begin
    q := q + cc[i];
    if q = n then begin
      fl := true;
      an := (aa[i] + aa[i + 1]) / 2;
    end;
  end;

  if not fl then NO;

  writeln('SOLUTION');
  writeln(b:0:10);
  for i := 1 to n do begin
    writeln(z[i] * a + b:0:10, ' ', z[i] * an:0:10, ' ', z[i]:0:10);
  end;
end.
