program box1;

{$APPTYPE CONSOLE}

var
 k1,k2,i,j,s,k,tt:longint;
 v:int64;
 a:array[1..6,1..2] of longint;
 ar,r2:array[1..6] of longint;
 T,tk:ARRAY[1..100] of longint;
 c,h:boolean;

procedure make;
var
 s1,s2,s3,i,s:longint;
Begin
//111111111111111111111111111111111
 v:=int64(t[1])*int64(t[2])*int64(t[3]);
 if v mod t[1]<>0 then Begin c:=false; exit; End;
 if v mod t[2]<>0 then Begin c:=false; exit; End;
 if v mod t[3]<>0 then Begin c:=false; exit; End;
 s1:=v div t[1]; s2:=v div t[2]; s3:=v div t[3];
 s:=0;
 for i:=1 to 6 do
  if (s<2)and(ar[i]=s1)and(r2[i]=0) then Begin r2[i]:=1;inc(s);End;

 if s<2 then Begin c:=false; exit; End;

 s:=0;
 for i:=1 to 6 do
  if (s<2)and(ar[i]=s2)and(r2[i]=0) then Begin r2[i]:=2;inc(s);End;
 if s<2 then Begin c:=false; exit; End;

 s:=0;
 for i:=1 to 6 do
  if (s<2)and(ar[i]=s3)and(r2[i]=0) then Begin r2[i]:=3;inc(s);End;

 if s<2 then Begin c:=false; exit; End;
//111111111111111111111

End;
begin
 assign(input,'box.in');reset(input);
 assign(output,'box.out');rewrite(output);
 for i:=1 to 6 do
 Begin
 read(a[i,1],a[i,2]);
 ar[i]:=a[i,1]*a[i,2];
 if a[i,1]>a[i,j] then Begin k1:=a[i,1];a[i,1]:=a[i,2];a[i,2]:=k1;End;
 End;
 tt:=0;
 for i:=1 to 6 do
  for j:=1 to 2 do
  Begin
   h:=false;

   for k:=1 to tt do
   if (t[k]=a[i,j])and(tk[k]<4) then begin inc(tk[k]); h:=true;end;

   if not h then
   Begin
    inc(tt);
    t[tt]:=a[i,j];
    tk[tt]:=1;
   End;
  End;
 c:=true;
 if tt<>3 then c:=false;
  make;
 if c then writeln('POSSIBLE') else writeln('IMPOSSIBLE');
 close(input);
 close(output);
end.

