program g;

{$APPTYPE CONSOLE}
Type
        TPoints         =  array[1..100,1..2] of extended;
var
        x               :  TPoints;
        Xmin,Xmax       :  extended;
        y               :  TPoints;
        Ymin,Ymax       :  extended;
        z               :  array[1..100] of extended;
        i,j             :  longint;
        N               :  longint;
        t               :  extended;

        Xt              :  extended;
        Amin,Amax       :  extended;
        Bmin,Bmax       :  extended;

        Tx,Ty           :  extended;
begin
        assign(input,'gunman.in');
        assign(output,'gunman.out');
        Reset(input);
        Rewrite(output);
        readln(N);
        for i:=1 to N do
              readln(x[i][1],y[i][1],x[i][2],y[i][2],z[i]);

        Xmin:=-1E16;
        Xmax:=1E16;
        Ymin:=-1E16;
        Xmax:=1E16;

        for i:=1 to N-1 do
                for j:=i+1 to N do
                begin
                        {Min}
                        t:=(x[j,2]-x[i,1])*z[i]/(z[i]-z[j])+x[i,1];
                        if t>Xmin then
                                Xmin:=t;
                        {Max}
                        t:=(x[j,1]-x[i,2])*z[i]/(z[i]-z[j])+x[i,2];
                        if t<Xmax then
                                Xmax:=t;
                end;
        {Y}
        for i:=1 to N-1 do
                for j:=i+1 to N do
                begin
                        {Min}
                        t:=(y[j,2]-y[i,1])*z[i]/(z[i]-z[j])+y[i,1];
                        if t>Ymin then
                                Ymin:=t;
                        {Max}
                        t:=(y[j,1]-y[i,2])*z[i]/(z[i]-z[j])+y[i,2];
                        if t<Ymax then
                                Ymax:=t;
                end;

        if (Xmax>=Xmin) and (Ymin<=0) and (Ymax>=0) then
        begin
                writeln('SOLUTION');
                Xt:=(Xmin+Xmax)/2;
                writeln(Xt:0:6);
                Amin:=-1E16;
                Amax:=1E16;
                for i:=1 to N do
                begin
                  t:=(x[i,1]-Xt)/z[i];
                  if t>Amin then
                        Amin:=t;
                  t:=(x[i,2]-Xt)/z[i];
                  if t<Amax then
                        Amax:=t;
                end;
                Amin:=(Amin+Amax)/2;

                Bmin:=-1E16;
                Bmax:=1E16;
                for i:=1 to N do
                begin
                  t:=(y[i,1])/z[i];
                  if t>Bmin then
                        Bmin:=t;
                  t:=(y[i,2])/z[i];
                  if t<Bmax then
                        Bmax:=t;
                end;
                Bmin:=(Bmin+Bmax)/2;

                for i:=1 to N do
                begin
                        Tx:=z[i]*Amin+Xt;
                        Ty:=z[i]*Bmin;
                        writeln(Tx:0:6,' ',Ty:0:6,' ',z[i]:0:6);
                end;

        end
        else
                writeln('UNSOLVABLE');




end.
