{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$MAXSTACKSIZE $3C00000}
{$APPTYPE CONSOLE}
type
 int = integer;
 real = extended;
var
a,b,c: array[0..100] of integer;
used: array[0..100,1..2] of boolean;
i,n,k,p,t: integer;
e: boolean;

{procedure rec(v: integer);
var
i: integer;
begin


end;}

begin
assign(input,'box.in');reset(input);
assign(Output,'box.out');rewrite(output);
n:=6;
for i:=1 to n do
  begin
  read(a[i],b[i]);
  c[i] := i;
  end;
k:=0;
for i:=1 to n do
  if a[i]=b[i] then
    begin
      inc(k);
      p:=a[i];  a[i]:=a[k];  a[k]:=p;
      p:=b[i];  b[i]:=b[k];  b[k]:=p;
    end;
//rec(1);
for k:=1 to 3 do
  begin
    p:=-1;
    t:=0;
    for i:=1 to n do
      begin
        if t=4 then break;
        if (p=-1) and not used[i,1] then
          begin
            t:=1;
            used[i,1]:=true;
            p:=a[i];
            a[i]:=-1;
            continue;
          end;
        if (p=-1) and not used[i,2] then
          begin
            t:=1;
            used[i,2]:=true;
            p:=b[i];
            b[i]:=-1;
            continue;
          end;
        if not used[i,1] and (a[i]=p) then
          begin
            inc(t);
            used[i,1]:=true;
            a[i]:=-1;
            continue;
          end;
        if not used[i,2] and (b[i]=p) then
          begin
            inc(t);
            used[i,2]:=true;
            b[i]:=-1;
            continue;
          end;
      end;
    if t<4 then
          begin
            write('IMPOSSIBLE');
            Halt;
          end;
    t:=0;
    for i:=1 to n do
      if a[i]=b[i] then
        begin
          inc(t);
          p:=a[i];  a[i]:=a[t];  a[t]:=p;
          e:=used[i,1];  used[i,1]:=used[t,1];  used[t,1]:=e;
          p:=b[i];  b[i]:=b[t];  b[t]:=p;
          e:=used[i,2];  used[i,2]:=used[t,2];  used[t,2]:=e;
        end;
  end;
write('POSSIBLE');
end.