program box;

{$APPTYPE CONSOLE}

var
 t,k1,k2,i,j,s:longint;
 a:array[1..6,1..2] of longint;
 c,h:boolean;
begin
 assign(input,'box.in');reset(input);
 assign(output,'box.out');rewrite(output);
 for i:=1 to 6 do
 read(a[i,1],a[i,2]);

 c:=true;
 repeat
 k1:=0;k2:=0;h:=false;
 for i:=1 to 6 do
 Begin
  for j:=1 to 2 do
  if a[i,j]<>0 then
   Begin
    k1:=i;k2:=j;
    h:=true;
    break;
   End;
 if h then break;
 End;
 if k1<>0 then
 Begin
  t:=a[k1,k2];s:=0;
  for i:=k1 to 6 do
   for j:=1 to 2 do
    if a[i,j]=t then Begin inc(s);if s<=4 then a[i,j]:=0;break;End;
  if s<4 then c:=false;  
 End;
 until (k1=0)or (not c);

 if c then writeln('POSSIBLE') else writeln('IMPOSSIBLE');
 close(input);
 close(output);
end.

