{$APPTYPE CONSOLE}
program box;

const
        st1='box.in';
        st2='box.out';
var
        ok:boolean;
        a:array[1..6] of integer;
        b:array[1..6] of integer;
        count,x,y,z:integer;
{******************}
procedure look;
begin
        assign(input,st1); reset(input);
        assign(output,st2); rewrite(output);

        for x:=1 to 6 do begin
                readln(a[x],b[x]);
        end;
end;
{******************}
procedure action;
label en;
begin
        ok:=false;

        for x:=1 to 5 do if a[x]>0 then begin
                for y:=x+1 to 6 do begin
                        if (a[x]=a[y])and(b[x]=b[y]) then begin
                                b[y]:=0; a[y]:=0; goto en;
                        end;
                        if (a[x]=b[y])and(b[x]=a[y]) then begin
                                b[y]:=0; a[y]:=0; goto en;
                        end;
                end;
                en:
        end;

        count:=0;
        for x:=1 to 6 do begin
                if a[x]>0 then inc(count);
                if b[x]>0 then inc(count);
        end; if count>6 then exit;

        for x:=1 to 6 do if a[x]>0 then begin
          for y:=1 to 6 do if (a[y]>0)and(y<>x) then begin
            for z:=1 to 6 do if (a[z]>0)and(y<>x)and(z<>y) then begin
                if (a[x]=b[x])and(a[y]=b[y])and(a[z]=b[z]) then begin

                   if (a[x]<>a[y])and(a[x]<>b[y])and
                      (a[x]<>a[z])and(a[x]<>b[z]) then exit;

                   if (a[y]<>a[x])and(a[y]<>b[x])and
                      (a[y]<>a[z])and(a[y]<>b[z]) then exit;

                   if (a[z]<>a[y])and(a[z]<>b[y])and
                      (a[z]<>a[x])and(a[z]<>b[x]) then exit;
                end;
            end;
          end;
        end;

        ok:=true;
end;
{******************}
procedure finish;
begin
        if ok then writeln('POSSIBLE')
        else       writeln('IMPOSSIBLE');
        
        close(input); close(output);
end;
{******************}
begin
        look;
        action;
        finish;
end.
