{$o-,q+,r+}
{ $o+,q-,r-}
{$MINSTACKSIZE $00004000}
{$APPTYPE console}
uses
    sysutils;
type
    int = longint;
const
    finname = 'box';
var
    a, b: array[1 .. 7] of int;
    i, j, t: int;
    f, ff: boolean;

procedure swap(const i: int);
var
    t: int;
begin
    t := a[i];
    a[i] := b[i];
    b[i] := t;
end;
var
    d2: array[1 .. 6] of int;
begin
    reset(input, finname + '.in');
    rewrite(output, finname + '.out');

    d2[1] := 1;
    for i := 2 to 6 do
        d2[i] := d2[i - 1] * 2;

    for i := 1 to 6 do begin
        read(a[i], b[i]);
        if (a[i] > b[i]) then begin
            t := a[i];
            a[i] := b[i];
            b[i] := t;
        end;
    end;

    {for i := 1 to 6 do begin
        f := false;
        for j := 1 to 6 do
            if (i <> j) and (a[i] = a[j]) and (b[i] = b[j]) then begin
                f := true;
                break;
            end;
        if (not f) then begin
            write('POSSIBLE');
            exit;
        end;
    end;}
    for i := 1 to 6 do
        for j := 1 to 5 do
            if (a[j + 1] < a[j]) or ((a[j + 1] = a[j]) and (b[j + 1] < b[j])) then begin
                t := a[j + 1];
                a[j + 1] := a[j];
                a[j] := t;
                t := b[j + 1];
                b[j + 1] := b[j];
                b[j] := t;
            end;

    for i := 0 to 2 do
        if (a[2 * i + 1] <> a[2 * i + 2]) or (b[2 * i + 1] <> b[2 * i + 2]) then begin
            write('IMPOSSIBLE');
            exit;
        end;
    for i := 1 to 6 do begin
        a[(i + 1) div 2] := a[i];
        b[(i + 1) div 2] := b[i];
    end;
    f := false;
    for j := 0 to 7 do begin
        for i := 1 to 3 do
            if ((j and d2[i]) > 0) then
                swap(i);
        a[4] := a[1];
        b[4] := b[1];
        ff := true;
          for i := 1 to 3 do
              if (a[i] <> b[i + 1]) then begin
                  ff := false;
                    break;
              end;
          if ff then begin
            f := true;
            break;
          end;
        for i := 1 to 3 do
            if ((j and d2[i]) > 0) then
                swap(i);
    end;
    if (not f) then
        write('IM');
    write('POSSIBLE');

end.
