{v$O-,I+,S+,R+,Q+,H-}

{$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}


const
  cinfile = 'gunman.in';
  coutfile = 'gunman.out';

  inf = maxlongint shr 1;
  eps = 1E-8;

  nmax = 111;

type
  int = longint;
  real = extended;
  float = extended;

  point = record
            x, y : real;
          end;

  plosk = record
            p1, p2 : point;
            z : real;
          end;

var
  n, k, m : int;

  ans : int;
  ansv : point;
  akx : real;

  a : array [1..nmax] of plosk;

procedure outdata;
var
  i, j : int;
  p : point;
begin
  writeln('SOLUTION');
  writeln(akx:0:6);
  for i := 1 to n do
  begin
    p.x := ansv.x * a[i].z + akx;
    p.y := ansv.y * a[i].z;
    writeln(p.x:0:6,' ',p.y:0:6,' ',a[i].z:0:6);
  end;
end;

function cross(var p1, p2, pm : point) : boolean;
begin
  cross:= (pm.x >= p1.x - eps) and (pm.x <= p2.x + eps) and
    (pm.y >= p1.y - eps) and (pm.y <= p2.y + eps);
end;

function ok(x, y, z2, z1 : real) : boolean;
var
  v : point;
  p : point;
  i, j : int;
  kx : real;
  min,max : real;

begin
  v.y:= y / z1;
  ok:= false;
  min := -inf;
  max := inf;
  for i:= 1 to n do
  begin
    p.y := v.y * a[i].z;

    if (p.y > a[i].p2.y + eps) or (p.y < a[i].p1.y - eps) then
    begin
      ok := false;
      exit;
    end;

    if abs (z2-a[i].z) < eps then continue;

    p.x := (x-a[i].p1.x)/(z2 - a[i].z);
    kx := a[i].p1.x - p.x*a[i].z;
    if kx > min + eps then min := kx;

    p.x := (x-a[i].p2.x)/(z2 - a[i].z);
    kx := a[i].p2.x - p.x*a[i].z;
    if kx < max - eps then max := kx;
  end;
  if max < min - eps then
  begin
    ok := false;
    exit;
  end;
  ok := true;
  kx := (min + max) / 2;
  v.x := (x-kx)/z2;
  ansv := v;
  akx := kx;
  outdata;
end;

function find(p1, p2 : plosk) : boolean;
begin
  find:= true;
  if ok(p1.p1.x, p2.p1.y, p1.z, p2.z) then exit;
  if ok(p1.p2.x, p2.p1.y, p1.z, p2.z) then exit;
  if ok(p1.p1.x, p2.p2.y, p1.z, p2.z) then exit;
  if ok(p1.p2.x, p2.p2.y, p1.z, p2.z) then exit;
  find:= false;
end;

procedure solve;
var
  i, j : int;
begin
  for i:= 1 to n do
    for j:= 1 to n do
      if find(a[i], a[j]) then exit;
  writeln('UNSOLVABLE');
end;

procedure readdata;
var
  i, j : int;
begin
  read(n);
  for i:= 1 to n do
  begin
    read(a[i].p1.x, a[i].p1.y);
    read(a[i].p2.x, a[i].p2.y);
    read(a[i].z);
  end;
end;

begin
  reset(input, cinfile);
  rewrite(output, coutfile);
  readdata;
  solve;
  close(output);
  close(input);
end.
