const
  InFile  = 'gunman.in';
  OutFile = 'gunman.out';

var
  inf, outf : textfile;
  n : integer;
  a : array[1..102] of record 
    x1, y1, x2, y2, z : real;
  end;
  tgmax, tgmin : real;
  xmax, xmin, x0, tb : real;
  beg : boolean;
  tbmax, tbmin : real;
  
procedure Init;
var i: integer;
begin
  Assign(inf, InFile);
  Assign(outf, OutFile);
  Reset(inf);
  Rewrite(outf);
  read(inf, n);
  for i := 1 to n do
  begin
    Read(inf,a[i].x1, a[i].y1, a[i].x2, a[i].y2, a[i].z); 
  end;
end;

procedure Run;
var 
  tgmax1, tgmin1, xmax1, xmin1 : real;
  tbmax1, tbmin1 : real;
  i, j, k, l : integer;
  x1, x2, x3, x4, tmp : real;
  x,y,z : real;
begin
  tgmax := -1;
  tgmin := -1;
  for i := 1 to n do
  begin
    tgmax1 := a[i].y2/a[i].z;
    tgmin1 := a[i].y1/a[i].z;
    if (tgmax1 < tgmax) or (tgmax = -1) then
    begin          
       tgmax := tgmax1;
    end;
    if (tgmin1 > tgmin) or (tgmin = -1) then
    begin
       tgmin := tgmin1;
    end;
  end;
  beg :=true;
  for i := 1 to n do
  begin
    for j := i + 1 to n do
    begin
      x1 := (-a[i].z/(a[j].z - a[i].z))*(a[j].x2 - a[i].x1) + a[i].x1;
      x2 := (-a[i].z/(a[j].z - a[i].z))*(a[j].x1 - a[i].x2) + a[i].x2;
      if (x2 < x1) then
      begin
        tmp := x2;
        x2 := x1;
        x1 := tmp;
      end;
      if ((beg) or (x1 > xmin)) then
      begin
        xmin := x1;
      end;
      if ((beg) or (x2 < xmax)) then
      begin
        xmax := x2;
        beg := false;
      end;
    end;
  end;
  if (tgmax < tgmin) then
  begin
    write(outf, 'UNSOLVABLE');
  end
  else
  begin
    if (xmax < xmin) then
    begin
      write(outf, 'UNSOLVABLE');
    end
    else 
    begin
      writeln(outf, 'SOLUTION');
      x0 := xmin;
      for i := 1 to n do
      begin
        a[i].x1 := a[i].x1 - x0;
        a[i].x2 := a[i].x2 - x0;
      end;
      beg := true;
      for i := 1 to n do
      begin
           tbmin1 := a[i].x1/a[i].z;
           tbmax1 := a[i].x2/a[i].z;
           if (tbmax1 < tbmax) or (beg) then
           begin          
             tbmax := tbmax1;
           end;
           if (tbmin1 > tbmin) or (beg) then
           begin
             tbmin := tbmin1;
             beg := false;
           end;
      end;
      tb := tbmin;
      writeln(outf, x0:0:6);
      for i := 1 to n do
      begin
        x := x0 + a[i].z*tb;
        y := tgmin * a[i].z;
        z := a[i].z;
        writeln(outf, x:0:6, ' ', y:0:6, ' ', z:0:6);
      end;
    end;
  end;
end;

procedure Done;
begin
  Close(inf);
  Close(outf);
end;


begin
  Init;
  Run;
  Done;
  Halt(0);
end.