{$o-,q+,r+}
{ $o+,q-,r-}
{$MINSTACKSIZE $00004000}
{$APPTYPE console}
uses
    sysutils, math;
const
    maxn = 1000;
procedure quitf;
begin
    write('UNSOLVABLE');
    halt(0);
end;
type
    int = longint;
    tarr = array[1 .. maxn] of extended;
    ext = extended;
const
    finname = 'gunman';

var
    z: tarr;
    n: int;
function ctan(a : ext) : ext;
begin
    if a = pi / 2 then result := 0
    else result := 1 / tan(a);
end;

function getan(const xl, xh: tarr; const x0, z0: ext): ext;
var
    i: int;
    t, l, h
    : ext;
begin
    l := -1e8;
    h := 1e8;
    for i := 1 to n do begin
        if (z[i] = z0) then
            continue;
        if (z[i] > z0) then begin
            t := arctan2(xh[i] - x0, z[i] - z0);
            if (h > t) then
                h := t;
            t := arctan2(xl[i] - x0, z[i] - z0);
            if (l < t) then
                l := t;
        end
        else begin
            t := -arctan2(xl[i] - x0, z0 - z[i]);
            if (h > t) then
                h := t;
            t := -arctan2(xh[i] - x0, z0 - z[i]);
            if (l < t) then
                l := t;
        end;
    end;
    if (l > h) then
        result := 1e8
    else
        result := (l + h) * 0.5;
end;
var
    x1, y1, x2, y2: tarr;
    i
    : int;
    al, be, xx, zz, b, k, bb
    :ext;
begin
    reset(input, finname + '.in');
    rewrite(output, finname + '.out');

    read(n);
    for i := 1 to n do begin
        read(x1[i], y1[i], x2[i], y2[i], z[i]);
    end;

    al := getan(y1, y2, 0, 0);
    if (al = 1e8) then
        quitf;
    zz := -1;
    for i := 1 to n do begin
        be := getan(x1, x2, x1[i], z[i]);
        if (be < 1e8) then begin
            xx := x1[i];
            zz := z[i];
            break;
        end;
        be := getan(x1, x2, x2[i], z[i]);
        if (be < 1e8) then begin
            xx := x2[i];
            zz := z[i];
            break;
        end;
    end;
    if (zz < 0) then
        quitf;
    k := ctan(be);
    b := xx - k * zz;
    bb := tan(al);
    writeln('SOLUTION');
    writeln(b : 0 : 6);

    for i := 1 to n do begin
        write(k * z[i] + b : 0 : 6, ' ');
        write(bb * z[i] : 0 : 6, ' ');
        writeln(z[i] : 0 : 6);
    end;
end.
