program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var     f1,f2:textfile;
        a,b,c : array of integer;
        s:boolean;
        i,j,t,t1,t2:integer;
begin
        setlength(a,6);
        setlength(b,6);
        setlength(c,12);
        assignfile(f1,'box.in');
        assignfile(f2,'box.out');
        reset(f1);
        rewrite(f2);
        for i:=1 to 6 do
        read(f1,a[i],b[i]);
        t:=1;
        t1:=1;
        t2:=1;
        c(1)=a(1);
        for i:=1 to 6 do
        begin
                s:=false;
                for j:=1 to t2 do
                begin
                        if c(j)=a(i) then s:=true;
                end;
                if s=false then
                begin
                        t1:=t1+1;
                        c(t1):=a(i);
                end;
                s:=false;
                t2:=t1;
                for j:=1 to t2 do
                begin
                        if c(j)=b(i) then s:=true;
                end;
                if s=false then
                begin
                        t1:=t1+1;
                        c(t1):=b(i);
                end;
                t2:=t1;
        end;
        if t1=3 then write(f2,'POSSIBLE'); else write(f2,'IMPOSSIBLE');
        closefile(f1);
        closefile(f2);
end.
