{$APPTYPE CONSOLE}
uses math;
var
  l, r, t1, t2, fi : extended;
  i, j, n, k : integer;
  x1, x2, y1, y2, z: array[1..100]of extended;
begin
  assign(input, 'gunman.in'); reset(input);
  assign(output, 'gunman.out'); rewrite(output);
  read(n);
  for i:=1 to n do read(x1[i], y1[i], x2[i], y2[i], z[i]);
  for i:=1 to n do for j:=i+1 to n do if(z[i]=z[j])then
  begin write('UNSOLVABLE'); halt; end;
  l := -10000000000; r := 10000000000;
  k := 1; for i:=2 to n do if z[i]>z[k] then k := i;
  for i:=1 to n do if i<>k then begin
    if r>(x2[i]+(x1[k]-x2[i])*(z[i]/(z[k]-z[i])))then
      r := x2[i]+(x1[k]-x2[i])*(z[i]/(z[k]-z[i]));
    if l<(x1[i]-(x2[k]-x1[i])*(z[i]/(z[k]-z[i])))then
      l := x1[i]-(x2[k]-x1[i])*(z[i]/(z[k]-z[i]));
  end;
  if l>r then begin write('UNSOLVABLE'); halt; end;
  l := (l+r)/2; l:=-1;
  fi := (l-x1[k])/z[k];

  t1 := y2[1]/z[1];
  t2 := y1[1]/z[1];
  for i:=2 to n do begin
    if t1>y2[i]/z[i] then t1 := y2[i]/z[i];
    if t2<y1[i]/z[i] then t2 := y1[i]/z[i];
  end;
//  t1 := pit1);
//  t2 := pi-arctan(t2);
  if t2<t1 then begin write('UNSOLVABLE'); halt; end;
  t1 := (t1+t2)/2;
  writeln('SOLUTION');
  writeln(l:0:6);
  for i:=1 to n do begin
    writeln( -fi*z[i]+l:0:6, ' ', t1*z[i]:0:6, ' ', z[i]:0:6);
  end;
end.
