{$DEFINE DEBUG}

{$IFDEF DEBUG}
{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$ELSE}
{$A+,B-,C+,D-,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$ENDIF}

{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $02000000}
{$APPTYPE CONSOLE}

uses
  Math, SysUtils;

type
  int = longint;
  float = extended;

const
  maxn = 200;
  cin_file = 'gunman.in';
  cout_file = 'gunman.out';
  eps : float = 1e-7;
  fmax : float = 1e40;
  besk = $3F3F3F3F;

type
  tseg = record
    z : float;
    c : array[0..1] of float;
  end;
  tar = array[1..maxn] of tseg;


var
  n : int;
  x, y : tar;

function project(x0, z0, x1, z1, z : float) : float;
begin
  project := x0 + (z - z0) * (x1 - x0) / (z1 - z0);
end;

procedure inter(n : int; const aa : tar; x0, z0, z : float; var s : tseg);
var
  i : int;
  a : tseg;
begin
  s.z := z;
  s.c[0] := - fmax;
  s.c[1] := fmax;

  for i := 1 to n do
  begin
    a.z := aa[i].z;
    a.c[0] := project(x0, z0, aa[i].c[0], aa[i].z, z);
    a.c[1] := project(x0, z0, aa[i].c[1], aa[i].z, z);
    if (a.c[0] > s.c[1] + eps) or (a.c[1] < s.c[0] - eps) then
    begin
      s.c[0] := fmax;
      s.c[1] := - fmax;
      exit;
    end;

    s.c[0] := max(s.c[0], a.c[0]);
    s.c[1] := min(s.c[1], a.c[1]);
  end;
end;

procedure solve;
var
  i, j, io, jo : int;
  ans_x0, ans_x1, ans_y1 : float;
  x0 : float;
  ans : boolean;
  tmp : tseg;
begin
  read(n);

  for i := 1 to n do
  begin
    read(x[i].c[0], y[i].c[0], x[i].c[1], y[i].c[1], x[i].z);
    y[i].z := x[i].z;
  end;
  if (n = 1) then
  begin
    writeln('SOLUTION');
    writeln(0.0:0:6);
    writeln(x[1].c[0]:0:6, ' ', y[1].c[0]:0:6, ' ', x[1].z:0:6);
    exit;
  end;

  inter(n, y, 0, 0, y[n].z, tmp);
  ans := tmp.c[0] < tmp.c[1] + eps;

  ans_x0 := 0;
  ans_x1 := 0;
  ans_y1 := 0;
  if (ans) then
  begin
    ans_y1 := (tmp.c[0] + tmp.c[1]) * 0.5;
    ans := false;
    for i := 1 to n do
      for j := i + 1 to n do
        for io := 0 to 1 do
          for jo := 0 to 1 do
          begin
            x0 := project(x[i].c[io], x[i].z, x[j].c[jo], x[j].z, 0);

            inter(n, x, x0, 0, x[n].z, tmp);
            if (tmp.c[0] < tmp.c[1] + eps) then
            begin
              ans := true;
              ans_x0 := x0;
              ans_x1 := (tmp.c[0] + tmp.c[1]) * 0.5;
            end;
          end;
  end;

  if (ans) then
  begin
    writeln('SOLUTION');
    writeln(ans_x0:0:6);
    for i := 1 to n do
    begin
      writeln(project(ans_x0, 0, ans_x1, x[n].z, x[i].z):0:6, ' ', project(0, 0, ans_y1, x[n].z, x[i].z):0:6, ' ', x[i].z:0:6);
    end;
  end
  else
    write('UNSOLVABLE');
end;

begin
  assign(input, cin_file);
  reset(input);
  assign(output,  cout_file);
  rewrite(output);

  solve;

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