{$APPTYPE CONSOLE}
program box;

const
        st1='box.in';
        st2='box.out';
var
        c:array[1..12] of integer;
        a:array[1..2,1..6] of integer;
        s,count,x,y,n,i,j:integer;
{******************}
procedure look;
begin
        assign(input,st1); reset(input);
        assign(output,st2); rewrite(output);

        for x:=1 to 6 do
        readln(a[1,x],a[2,x]);
end;
{******************}
procedure action;
begin
        for x:=1 to 2 do
        for y:=1 to 6 do
                if a[x,y]>0 then begin
                    count:=0;

                    for i:=1 to 2 do
                    for j:=1 to 6 do 
                    if (a[x,y]=a[i,j]) then inc(count);

                    if count>=4 then begin
                        inc(n);
                        s:=a[x,y];
                        for i:=1 to 2 do
                        for j:=1 to 6 do
                        if s=a[i,j] then begin a[i,j]:=0; dec(count); if count=0 then break; end;
                    end;
                end;
end;
{******************}
procedure finish;
begin

        if n=3 then writeln('POSSIBLE')
        else        writeln('IMPOSSIBLE');

        close(input); close(output);
end;
{******************}
begin
        look;
        action;
        finish;
end.
