{$APPTYPE CONSOLE}

program zzz;

const
  eps = 1e-4;

type
  point = record
    x,y: Double;
  end;

var
  i,j,k,n,m,t,p: Longint;
  b,a: array[1..100,1..2] of Point;
  xa,vp1,vp2: Double;
  pp: Point;
  ax,ay,az: array[1..100] of Double;
  f1,f2,ff: Boolean;

function vectorp(a,b,c: Point): Double;
begin
  vectorp := (a.x - b.x) * (c.y - b.y) - (a.y - b.y) * (c.x - b.x);
end;

function cross(p1,p2: Point; xx: Double): Double;
begin
  cross := p1.x + (p1.x - p2.x) * (p1.y - xx) / (p2.y - p1.y);
end;

begin
  assign(input,'gunman.in'); reset(input);
  assign(output,'gunman.out'); rewrite(output);
  read(n);
  for i := 1 to n do begin
    read(b[i,1].x,a[i,1].x,b[i,2].x,a[i,2].x,a[i,1].y);
    a[i,2].y := a[i,1].y;
    b[i,1].y := a[i,2].y;
    b[i,2].y := b[i,1].y;
    az[i] := b[i,2].y;
  end;

  f1 := false;
  pp.x := 0;
  pp.y := 0;

  f1 := false;
  for i := 1 to n do begin
    if f1 then break;
    for j := 1 to 2 do begin
      if f1 then break;

      ff := true;
      for t := 1 to n do begin
        vp1 := vectorp(pp,a[i,j],a[t,1]);
        vp2 := vectorp(pp,a[i,j],a[t,2]);
        if (abs(vp1) < eps) or (abs(vp2) < eps) then continue else begin
          if vp1*vp2 < 0 then continue else begin
            ff := false;
            break;
          end;
        end;
      end;
      if ff then begin
        f1 := true;
        for t := 1 to n do begin
          ay[t] := cross(pp,a[i,j],az[t]);
        end;
      end;
    end;
  end;

  f2 := false;
  for i := 1 to n do begin
    if f2 then break;
    for j := i+1 to n do begin
      if f2 then break;
      for k := 1 to 2 do begin
        if f2 then break;
        for t := 1 to 2 do begin

          if f2 then break;
          ff := true;
          for p := 1 to n do begin
            vp1 := vectorp(b[i,k],b[j,t],b[p,1]);
            vp2 := vectorp(b[i,k],b[j,t],b[p,2]);
            if (abs(vp1) < eps) or (abs(vp2) < eps) then begin
              continue;
            end else begin
              if vp1 * vp2 < 0 then continue else begin
                ff := false;
                break;
              end;
            end;
          end;

          if ff then begin
            f2 := true;
            xa := cross(b[i,k],b[j,t],0);
            for p := 1 to n do begin
              ax[p] := cross(b[i,k],b[j,t],az[p]);
            end;
          end;

        end;
      end;
    end;
  end;

  if f1 and f2 then begin
    writeln('SOLUTION');
    writeln(xa:0:6);
    for i := 1 to n do begin
      writeln(ax[i]:0:6,' ',ay[i]:0:6,' ',az[i]:0:6);
    end;
  end else writeln('UNSOLVABLE');
  close(input);
  close(output);
end.