program pb3;

{$APPTYPE CONSOLE}

type
        dsp = record
                w :word;
                h :word;
        end;

var
        dsps :array[1..6] of dsp;
        pairs :array[1..3] of dsp;
        f :text;
        i,j,k :byte;
        sign :word;
        possible :boolean;

begin
possible:=false;
sign:=11000;
k:=1;
assignfile(f,'box.in');
reset(f);
for i:=1 to 6 do
begin
        read(f,dsps[i].w);
        read(f,dsps[i].h);
end;
closefile(f);
for i:=1 to 5 do
for j:=i+1 to 6 do
if not (dsps[i].w>10000) then
if ((dsps[i].w = dsps[j].h) and (dsps[i].h = dsps[j].w))
or ((dsps[i].w = dsps[j].w) and (dsps[i].h = dsps[j].h)) then
begin
        pairs[k].w:=dsps[i].w;
        pairs[k].h:=dsps[i].h;
        dsps[j].w:=sign;
        dsps[j].h:=sign;
        inc(sign);
        inc(k);
end;
if ((pairs[1].w=pairs[2].w) and (((pairs[3].w=pairs[2].h) and (pairs[3].h=pairs[1].h)) or ((pairs[3].w=pairs[1].h) and (pairs[3].h=pairs[2].h)))) then possible:=true;
if ((pairs[1].w=pairs[2].h) and (((pairs[3].w=pairs[2].w) and (pairs[3].h=pairs[1].h)) or ((pairs[3].w=pairs[1].h) and (pairs[3].h=pairs[2].w)))) then possible:=true;
if ((pairs[1].h=pairs[2].w) and (((pairs[3].w=pairs[2].h) and (pairs[3].h=pairs[1].w)) or ((pairs[3].w=pairs[1].w) and (pairs[3].h=pairs[2].h)))) then possible:=true;
if ((pairs[1].h=pairs[2].h) and (((pairs[3].w=pairs[2].w) and (pairs[3].h=pairs[1].w)) or ((pairs[3].w=pairs[1].w) and (pairs[3].h=pairs[2].w)))) then possible:=true;
if ((pairs[1].w=pairs[3].w) and (((pairs[2].w=pairs[3].h) and (pairs[2].h=pairs[1].h)) or ((pairs[2].w=pairs[1].h) and (pairs[2].h=pairs[3].h)))) then possible:=true;
if ((pairs[1].w=pairs[3].h) and (((pairs[2].w=pairs[3].w) and (pairs[2].h=pairs[1].h)) or ((pairs[2].w=pairs[1].h) and (pairs[2].h=pairs[3].w)))) then possible:=true;
if ((pairs[1].h=pairs[3].w) and (((pairs[2].w=pairs[3].h) and (pairs[2].h=pairs[1].w)) or ((pairs[2].w=pairs[1].w) and (pairs[2].h=pairs[3].h)))) then possible:=true;
if ((pairs[1].h=pairs[3].h) and (((pairs[2].w=pairs[3].w) and (pairs[2].h=pairs[1].w)) or ((pairs[2].w=pairs[1].w) and (pairs[2].h=pairs[3].w)))) then possible:=true;
assignfile(f,'box.out');
rewrite(f);
if possible then writeln(f,'POSSIBLE') else writeln(f,'IMPOSSIBLE');
closefile(f);
end.
