var
 fin,fout:textfile;
 map:array[1..6,1..3] of longint;
 m1,m2,i,j,k:longint;
 b:boolean;
begin
  assignfile(fin,'box.in');
  assignfile(fout,'box.out');
  reset(fin);
  rewrite(fout);
  for i:=1 to 6 do begin
   readln(fin,m1,m2);
   map[i,1]:=m1;
   map[i,2]:=m2;
  end;
  for i:=1 to 6 do
   if map[i,1]>map[i,2] then begin
    j:=map[i,1];
    map[i,1]:=map[i,2];
    map[i,2]:=j;
   end;
  for i:=1 to 6 do map[i,3]:=map[i,1]*20000+map[i,2];
  for j:=1 to 6 do
   for i:=1 to 5 do
    if map[i,3]>map[i+1,3] then begin
     k:=map[i,1]; map[i,1]:=map[i+1,1]; map[i+1,1]:=k;
     k:=map[i,2]; map[i,2]:=map[i+1,2]; map[i+1,2]:=k;
     k:=map[i,3]; map[i,3]:=map[i+1,3]; map[i+1,3]:=k;
    end;
  b:=true;
  b:=b and (map[1,3]=map[2,3]);
  b:=b and (map[3,3]=map[4,3]);
  b:=b and (map[5,3]=map[6,3]);
  b:=b and (map[1,1]=map[3,1]);
  b:=b and (map[1,2]=map[5,1]);
  b:=b and (map[3,2]=map[5,2]);
  if b then writeln(fout,'POSSIBLE') else writeln(fout,'IMPOSSIBLE');
  closefile(fin);
  closefile(fout);
end.