program g;

{$APPTYPE CONSOLE}
{$R+,Q+,S+,H+}

uses
  Math,
  SysUtils;

Type
  Integer=LongInt;
  Real=Extended;

Const
  TaskID='gunman';
  InFile=TaskID+'.in';
  OutFile=TaskID+'.out';
  MaxN=102;

Type
  TWin=Record
    X1,Y1,X2,Y2,Z:Integer;
  End;

Var
  N:Integer;
  W:Array[1..MaxN]Of TWin;
  X1,Z1,X2,Z2,Y3,Z3:Integer;
  IsSol:Boolean;

Procedure Load;
Var
  I:Integer;
Begin
  ReSet(Input,InFile);
  Read(N);
  For I:=1 To N Do With W[I] Do
    Read(X1,Y1,X2,Y2,Z);
  Close(Input);
End;

Function Try1(X1,Z1,X2,Z2:Integer):Boolean;
Var
  I,A,B,Z,V1,V2,V3:Integer;
Begin
  Try1:=False;
  For I:=1 To N Do Begin
    A:=W[I].X1;
    B:=W[I].X2;
    Z:=W[I].Z;
    V1:=(A*(Z1-Z2)-(X1-X2))*Z1;
    V2:=Z*(X1*(Z1-Z2)-(X1-X2));
    V3:=(B*(Z1-Z2)-(X1-X2))*Z1;
    If (Z1<Z2) Then Begin
      V1:=-V1;
      V2:=-V2;
      V3:=-V3;
    End;
    If (V1>V2) Or (V2>V3) Then Exit;
  End;
  Try1:=True;
End;

Function Try2(Y3,Z3:Integer):Boolean;
Var
  I:Integer;
Begin
  Try2:=False;
  For I:=1 To N Do With W[I] Do If (Y1*Z3>Z*Y3) Or (Z*Y3>Y2*Z3) Then Exit;
  Try2:=True;
End;

Procedure Solve;
Var
  I,II,J,JJ,K,KK:Integer;
Label L1,L2;
Begin
  IsSol:=False;
  For I:=2 To N Do
    For II:=0 To 1 Do Begin
      Z1:=W[I].Z;
      If II=0 Then X1:=W[I].X1 Else X1:=W[I].X2;
      For J:=1 To I-1 Do
        For JJ:=0 To 1 Do Begin
          Z2:=W[J].Z;
          If JJ=0 Then X2:=W[J].X1 Else X2:=W[J].X2;
          If Try1(X1,Z1,X2,Z2) Then Goto L1;
        End;
    End;
  Exit;
L1:
  For K:=1 To N Do
    For KK:=0 To 1 Do Begin
      Z3:=W[K].Z;
      If KK=0 Then Y3:=W[K].Y1 Else Y3:=W[K].Y2;
      If Try2(Y3,Z3) Then Goto L2;
    End;
  Exit;
L2:
  IsSol:=True;
End;

Procedure Save;
Var
  X0,DX,DY:Real;
  I:Integer;
Begin
  ReWrite(Output,OutFile);
  If IsSol Then Begin
    WriteLn('SOLUTION');
    DY:=Y3/Z3;
    DX:=(X1-X2)/(Z1-Z2);
    X0:=X1-DX*Z1;
    WriteLn(X0:0:6);
    For I:=1 To N Do WriteLn(X0+DX*W[I].Z:0:6,' ',DY*W[I].Z:0:6,' ',W[I].Z+0.0:0:6);
  End Else WriteLn('UNSOLVABLE');
  Close(Output);
End;

begin
  Load;
  Solve;
  Save;
end.
 