program prG;

{$APPTYPE CONSOLE}

const Eps=1e-10;

var N, i, j: integer;
    X1, Y1, X2, Y2, Z: array [1..100] of integer;
    MinY, MaxY, X, Y, MinX, MaxX: extended;
    XS, XP, YP, ZP: 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]);

  MinX:=-10000000;
  MaxX:=10000000;

  for j:=2 to N do begin
    for i:=1 to j-1 do begin
      X:=(-Z[i]*(X2[j]-X1[i])+X1[i]*(Z[j]-Z[i]))/(Z[j]-Z[i]);
      if X>MinX then MinX:=X;
      X:=(-Z[i]*(X1[j]-X2[i])+X2[i]*(Z[j]-Z[i]))/(Z[j]-Z[i]);
      if X<MaxX then MaxX:=X;
    end;
    if (MinX>MaxX+Eps) then begin
      writeln('UNSOLVABLE');
      halt(0);
    end;
  end;

  MinY:=-10000000;
  MaxY:=10000000;
  for j:=2 to N do begin
    for i:=1 to j-1 do begin
      Y:=(-Z[i]*(Y2[j]-Y1[i])+Y1[i]*(Z[j]-Z[i]))/(Z[j]-Z[i]);
      if Y>MinY then MinY:=Y;
      Y:=(-Z[i]*(Y1[j]-Y2[i])+Y2[i]*(Z[j]-Z[i]))/(Z[j]-Z[i]);
      if Y<MaxY then MaxY:=Y;
    end;
    if (MinY>MaxY+Eps) then begin
      writeln('UNSOLVABLE');
      halt(0);
    end;
  end;

  if (MinY<Eps) and (MaxY>-Eps) then begin
    writeln('SOLUTION');
    XS:=MinX;
    XP:=X1[1]-XS;
    YP:=Y1[1];
    ZP:=Z[1];


    for i:=2 to N do begin
      if (X1[i]-XS)*ZP-XP*Z[i]>0 then begin
        XP:=X1[i]-XS;
        YP:=YP*Z[i]/ZP;        
        ZP:=Z[i];
      end;
      if Y1[i]*ZP-YP*Z[i]>0 then begin
        YP:=Y1[i];
        XP:=XP*Z[i]/ZP;        
        ZP:=Z[i];
      end;
    end;

    writeln(XS:0:6);
    for i:=1 to N do begin
      writeln(XS+XP*Z[i]/ZP:0:6, ' ', YP*Z[i]/ZP:0:6, ' ', 1.0*Z[i]:0:6);
    end;

  end else writeln('UNSOLVABLE');

end.
