{$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}
program g;

{$APPTYPE CONSOLE}
Type Real=Extended;
     TRect=
      Record
        x1,y1,x2,y2,z:Longint;
      End;
     TPoint=
      Record
        X,Y:Real;
      End;
     TLine=
      Record
        A,B,C:Real;
      End;

Var I,J,K,L,N,M:Longint;
    A:Array[1..100] Of TRect;
    B,C:Array[1..10000,1..2] Of Real;
    P,P1,P2,P3:TPoint;
    L1,L2,L3:TLine;
    BBB:Boolean;
    a1,aa,bb:Real;

Procedure Merge(p,q,r:Longint);
 Var I,J,K:Longint;
Begin
  I:=p;
  J:=q+1;
  For K:=p To r Do
   If (I>q) Or ((J<=r) And (B[J,1]>B[I,1])) Then
    Begin
      C[K]:=B[J];
      Inc(J);
    End
   Else
    Begin
      C[K]:=B[I];
      Inc(I);
    End;
  For K:=p To r Do
   B[K]:=C[K];
End;

Procedure Sort(p,r:Longint);
 Var q:Longint;
Begin
  If p<r Then
   Begin
     q:=(p+r) SHR 1;
     Sort(p,q);
     Sort(q+1,r);
     Merge(p,q,r);
   End;
End;

Procedure Merge1(p,q,r:Longint);
 Var I,J,K:Longint;
Begin
  I:=p;
  J:=q+1;
  For K:=p To r Do
   If (I>q) Or ((J<=r) And (B[J,2]<B[I,2])) Then
    Begin
      C[K]:=B[J];
      Inc(J);
    End
   Else
    Begin
      C[K]:=B[I];
      Inc(I);
    End;
  For K:=p To r Do
   B[K]:=C[K];
End;

Procedure Sort1(p,r:Longint);
 Var q:Longint;
Begin
  If p<r Then
   Begin
     q:=(p+r) SHR 1;
     Sort1(p,q);
     Sort1(q+1,r);
     Merge1(p,q,r);
   End;
End;

begin
  Assign(input,'gunman.in');
  Reset(input);
  Assign(output,'gunman.out');
  ReWrite(output);
   ReadLn(N);
   For I:=1 To N Do
    Read(A[I].x1,A[I].y1,A[I].x2,A[I].y2,A[I].z);
   K:=0;
   For I:=1 To N-1 Do
    For J:=I+1 To N Do
     Begin
       Inc(K);
       B[K,1]:=(A[I].X1*A[J].Z-A[J].x2*A[I].Z)/(A[J].Z-A[I].Z);
       B[K,2]:=(A[I].X2*A[J].Z-A[J].x1*A[I].Z)/(A[J].Z-A[I].Z);
     End;
   Sort(1,K);
   aa:=B[1,1];
   a1:=aa;
   Sort1(1,K);
   If (B[1,2]<aa-1e-7) Then
    Begin
      WriteLn('UNSOLVABLE');
      Close(input);
      Close(output);
      Exit;
    End;
   K:=0;
   For I:=1 To N-1 Do
    For J:=I+1 To N Do
     Begin
       aa:=(A[I].Y1*A[J].Z-A[J].Y2*A[I].Z)/(A[J].Z-A[I].Z);
       bb:=(A[I].Y2*A[J].Z-A[J].Y1*A[I].Z)/(A[J].Z-A[I].Z);
       If Not ((aa<1e-7) And (bb>-1e-7)) Then
        Begin
          WriteLn('UNSOLVABLE');
          Close(input);
          Close(output);
          Exit;
        End;
     End;
   WriteLn('SOLUTION');
   For I:=1 To N Do
    Begin
      p1.x:=A[I].X1;
      p1.Y:=A[I].Z;
      BBB:=True;
      For J:=1 To N Do
       Begin
         bb:=a1+(p1.X-a1)/p1.Y*A[J].Z;
         If Not ((A[J].x1<bb+1e-7) And (A[J].x2>bb-1e-7)) Then
          Begin
            BBB:=False;
            Break;
          End;
       End;
      If BBB Then
       Begin
         p3:=p1;
         Break;
       End;
      p1.x:=A[I].X2;
      p1.Y:=A[I].Z;
      BBB:=True;
      For J:=1 To N Do
       Begin
         bb:=a1+(p1.X-a1)/p1.Y*A[J].Z;
         If Not ((A[J].x1<bb+1e-7) And (A[J].x2>bb-1e-7)) Then
          Begin
            BBB:=False;
            Break;
          End;
       End;
      If BBB Then
       Begin
         p3:=p1;
         Break;
       End;
    End;
   For I:=1 To N Do
    Begin
      p1.x:=A[I].Y1;
      p1.Y:=A[I].Z;
      BBB:=True;
      For J:=1 To N Do
       Begin
         bb:=(p1.X)/p1.Y*A[J].Z;
         If Not ((A[J].y1<bb+1e-7) And (A[J].y2>bb-1e-7)) Then
          Begin
            BBB:=False;
            Break;
          End;
       End;
      If BBB Then
       Begin
         p2:=p1;
         Break;
       End;
      p1.x:=A[I].Y2;
      p1.Y:=A[I].Z;
      BBB:=True;
      For J:=1 To N Do
       Begin
         bb:=(p1.X)/p1.Y*A[J].Z;
         If Not ((A[J].y1<bb+1e-7) And (A[J].y2>bb-1e-7)) Then
          Begin
            BBB:=False;
            Break;
          End;
       End;
      If BBB Then
       Begin
         p2:=p1;
         Break;
       End;
    End;
   WriteLn(a1:1:6);
   For I:=1 To N Do
    Begin
      aa:=a1+(p3.X-a1)/p3.Y*A[I].Z;
      bb:=(p2.X)/p2.Y*A[I].Z;
      WriteLn(AA:0:6,' ',bb:0:6,' ',A[I].Z,'.000000');
    End;
  Close(input);
  Close(output);
end.
