label 1;
var a,b,c,d:array[0..7] of longint;
    check:array[0..7] of boolean;
    i,j,k:longint;
    f,t:boolean;
    procedure sorta;
      var i,j,k:longint;
          c:char;
          f:boolean;
          begin
            repeat
              f:=true;
              for i:=1 to 5 do
                if a[i]>a[i+1] then
                  begin
                     k:=a[i];
                     a[i]:=a[i+1];
                     a[i+1]:=k;
                     k:=b[i];
                     b[i]:=b[i+1];
                     b[i+1]:=k;
                     f:=false;
                  end;
            until f;
          end;
    procedure sortb;
      var i,j,k:longint;
          c:char;
          f:boolean;
          begin
            repeat
              f:=true;
              for i:=1 to 5 do
                if (a[i]=a[i+1]) and (b[i]>b[i+1])  then
                  begin
                     k:=a[i];
                     a[i]:=a[i+1];
                     a[i+1]:=k;
                     k:=b[i];
                     b[i]:=b[i+1];
                     b[i+1]:=k;
                     f:=false;
                  end;
            until f;
          end;
begin
  assign(input,'box.in');
  reset(input);
  assign(output,'box.out');
  rewrite(output);
  for i:=1 to 6 do
    begin
      read(a[i],b[i]);
      if a[i]>b[i] then
        begin
          k:=a[i];
          a[i]:=b[i];
          b[i]:=k;
        end;
    end;
  sorta;
  sortb;
  for i:=1 to 4 do
    check[i]:=true;
  f:=true;
  if (a[1]=a[2]) and (b[1]=b[2]) and (a[3]=a[4]) and (b[3]=b[4]) and
     (a[5]=a[6]) and (b[5]=b[6]) then f:=true else f:=false;
  if f then
    begin
      c[1]:=a[1];d[1]:=b[1];
      check[1]:=false;
      t:=true;
      if b[1]=a[3] then begin if ((a[5]=a[1]) and (b[5]=b[3])) or ((a[5]=b[3]) and (b[5]=a[1])) then
      begin f:=f;goto 1; end; end else
      if b[1]=b[3] then begin if ((a[5]=a[1]) and (b[5]=a[3])) or ((a[5]=a[3]) and (b[5]=a[1])) then
      begin f:=f;goto 1; end; end else
      if b[1]=a[5] then begin if ((a[3]=a[1]) and (b[5]=b[3])) or ((a[3]=b[5]) and (b[3]=a[1])) then
      begin f:=f;goto 1; end; end else
      if b[1]=b[5] then begin if ((a[3]=a[1]) and (a[5]=b[3])) or ((a[1]=b[3]) and (a[5]=a[3])) then
      begin f:=f;goto 1; end; end;
      f:=false;
{      if t then f:=false;
      if t=false then
      if (d[2]=a[3]) and (check[2]) then begin t:=false;c[3]:=a[3];d[3]:=b[3];check[2]:=false;end else
      if (d[2]=b[3]) and (check[2]) then begin t:=false;c[3]:=b[3];d[3]:=a[3];check[2]:=false;end else
      if (d[2]=a[5]) and (check[3]) then begin t:=false;c[3]:=a[5];d[3]:=b[5];check[3]:=false;end else
      if (d[2]=b[5]) and (check[3]) then begin t:=false;c[3]:=b[5];d[3]:=a[5];check[3]:=false;end;
      if t then f:=false;
      if c[1]<>d[3] then f:=false;}
      1:
    end;
  if f then writeln('POSSIBLE') else writeln('IMPOSSIBLE');
  close(input);
  close(output);
end.
