
{$APPTYPE CONSOLE}
const
 inp='box.in';
  out='box.out';
var
 a:array[1..6]of record
    i,j:integer;END;
 kol3, bol:boolean;
x,b:array[1..6]of integer;

procedure init;
var i,k:integer;
 begin
  assign(input,inp);
   reset(input);
     for i:=1 to 6 do begin

      read(a[i].i,a[I].j);
      if a[i].i>a[i].j then begin
          k:=a[i].i;
           a[i].i:=a[i].j;
          a[i].j:=k;end;
     end;
   close(input);
end;
Procedure solve;
var c:array[1..6]of boolean;
    kol2,kol,kol1:boolean;

i,j,t:integer;
begin
bol:=true;
 fillchar(c,sizeof(c),false);
   t:=1;
 for i:=1 to 5 do
  if c[i]=false then
   for j:=i+1 to 6 do
    if c[j]=false then
     if (a[i].I=a[j].i)and(a[i].j=a[j].j) then begin
        c[i]:=true;c[j]:=true;b[i]:=t;b[j]:=0;inc(t);end;
if t<4 then bol:=false;

for i:=1 to 6 do
 if c[i]=false then bol:=false;
 t:=1;

for i:=1 to 3 do
 for j:=1 to 6 do
  if b[j]=i then begin
   x[t]:=a[j].i;
   x[t+1]:=a[j].j;
    inc(t,2);
    end;

kol:=(((x[2]=x[3])and(x[4]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[3])and(x[4]=x[6])and(x[5]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[5]=x[1])));
   i:=x[3];x[3]:=x[5];x[5]:=i;
   i:=x[4];x[4]:=x[6];x[6]:=i;

kol1:=(((x[2]=x[3])and(x[4]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[3])and(x[4]=x[6])and(x[5]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[5]=x[1])));
   i:=x[3];x[3]:=x[5];x[5]:=i;
   i:=x[4];x[4]:=x[6];x[6]:=i;

i:=x[1];x[1]:=x[2];x[2]:=i;
kol2:=(((x[2]=x[3])and(x[4]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[3])and(x[4]=x[6])and(x[5]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[5]=x[1])));

   i:=x[3];x[3]:=x[5];x[5]:=i;
   i:=x[4];x[4]:=x[6];x[6]:=i;
kol3:=(((x[2]=x[3])and(x[4]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[3])and(x[4]=x[6])and(x[5]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[6]=x[1]))or
             ((x[2]=x[4])and(x[3]=x[5])and(x[5]=x[1])));
 bol:=bol and (kol or kol1 or kol2 or kol3);

 end;


procedure done;
var i:integer;
begin
 assign(output,out);
  rewrite(output);
   if bol then write('POSSIBLE') ELSE WRITE('IMPOSSIBLE');
  close(output);
end;

begin
init;
 solve;
  done;
end.
 