program G;

{$APPTYPE CONSOLE}

uses
  SysUtils;

Const Eps = 0.000000000001;

Var X1,X2,Y1,Y2,Z       : array [1..100] of extended;
    Vx,Vy,X0,Loy,Hiy    : extended;
    i,j,k,N             : longint;

Function satisfy(cvx, cx0 : extended) : boolean;
var i1,i2       : longint;
    cx,cy       : extended;
    Ans         : boolean;
Begin
  Ans:=true;
  For i1:=1 to N do Begin
    cx:=cx0+cvx*Z[i1];
    cy:=Vy*Z[i1];
    Ans:=Ans AND (cy-Y2[i1]<Eps);
    Ans:=Ans AND (Y1[i1]-cy<Eps);
    Ans:=Ans AND (cx-x2[i1]<Eps);
    Ans:=Ans AND (x1[i1]-cx<Eps);
  End;
  satisfy:=Ans;
End;

begin
  { TODO -oUser -cConsole Main : Insert code here }
  assignFile(input,'gunman.in'); reset(input);
  assignFile(output,'gunman.out'); rewrite(output);

  Readln(N);
  For i:=1 to N do Readln(X1[i],Y1[i],X2[i],Y2[i],Z[i]);

  Loy:=-1.0; Hiy:=2000;


  For i:=1 to N do Begin
    If Y1[i]/Z[i]>Loy then Loy:=Y1[i]/Z[i];
    If Y2[i]/Z[i]<Hiy then Hiy:=Y2[i]/Z[i];
  End;

  If (Loy-Hiy>Eps) then Begin
    Writeln('UNSOLVABLE');
    close(input); close(output);
    Halt(0);
  End;

  Vy:=Loy;

  For i:=1 to N do
  For j:=1 to N do
  If i<>j then Begin
    Vx:=(X1[i]-X2[j])/(Z[i]-Z[j]);
    X0:=X2[j]-(X2[j]-X1[i])*(Z[j]/(Z[j]-Z[i]));
    If Satisfy(Vx, X0) then Begin
      Writeln('SOLUTION');
      Writeln(X0:0:6);
      For k:=1 to N do
      Writeln(X0+Vx*Z[k]:0:6,' ', Vy*Z[k]:0:6,' ', Z[k]:0:6);
      close(input); close(output);
      halt(0);
    End;
  End;

  Writeln('UNSOLVABLE');
  close(input); close(output);
end.
