{******************From team T03************************}

program Project1;
 {$APPTYPE CONSOLE}
 Var a : array[1..6,1..2] of integer;
     b : array[1..6] of byte;
     ans : boolean;

 Procedure Load;
 Var i : integer;
 Begin
  assign(input,'box.in');
  reset(input);
  For i:=1 to 6 do
   readln(a[i,1],a[i,2]);
  close(input);
 End;
{--------------------------------------------------------------------------}
 Procedure Solve;
 Var i,j : integer;
{     est : boolean;
     an  : boolean;}
     c1,c2,c3 : integer;
 Begin
  Fillchar(b,sizeof(b),0);
  ans:=true;
  For i:=1 to 6 do
   For j:=i+1 to 6 do
    If(b[i]=0)and(b[j]=0)Then
    Begin
     If(a[i,1]=a[j,1])and(a[i,2]=a[j,2])Then
     Begin
      b[j]:=1;
      break;
     End;
     If(a[i,2]=a[j,1])and(a[i,1]=a[j,2])Then
     Begin
      b[j]:=1;
      break;
     End;
    End;
  j:=0;
  For i:=1 to 6 do
   If(b[i]=0)Then
    inc(j);
  If(j<>3)Then
  Begin
   ans:=false;
   exit;
  End;
  c1:=0;
  c2:=0;
  c3:=0;
  For i:=1 to 6 do
   If(b[i]=0)Then
   Begin
    If(c1=0)Then
    Begin
     c1:=i;
     continue;
    End;
    If(c2=0)Then
    Begin
     c2:=i;
     continue;
    End;
    If(c3=0)Then
    Begin
     c3:=i;
     continue;
    End;
   End;

  ans:=false;
  If(a[c1,1]=a[c2,1])Then
  Begin
   If(a[c1,2]=a[c3,2])Then
   Begin
    If(a[c2,2]=a[c3,1])Then
     ans:=true;
   End
   Else
   If(a[c1,2]=a[c3,1])Then
    If(a[c2,2]=a[c3,2])Then
     ans:=true;
  End
  Else
  If(a[c1,1]=a[c2,2])Then
  Begin
   If(a[c1,2]=a[c3,2])Then
   Begin
    If(a[c2,1]=a[c3,1])Then
     ans:=true;
   End
   Else
   If(a[c1,2]=a[c3,1])Then
    If(a[c2,1]=a[c3,2])Then
     ans:=true;
  End
  Else
  If(a[c1,2]=a[c2,1])Then
  Begin
   If(a[c1,1]=a[c3,1])Then
   Begin
    If(a[c2,2]=a[c3,2])Then
     ans:=true;
   End
   Else
   If(a[c1,1]=a[c3,2])Then
    If(a[c2,2]=a[c3,1])Then
     ans:=true;
  End
  Else
  If(a[c1,2]=a[c2,2])Then
  Begin
   If(a[c1,1]=a[c3,1])Then
   Begin
    If(a[c2,1]=a[c3,2])Then
     ans:=true;
   End
   Else
   If(a[c1,1]=a[c3,2])Then
    If(a[c2,1]=a[c3,1])Then
     ans:=true;
  End;

{  Begin
   c1:=0;
   For i:=1 to 6 do
    If(b[i]=0)Then
    Begin
     c1:=i;
     b[i]:=1;
     break;
    End;
   c2:=0;
   c3:=0;
   If c1>0 Then
   Begin
    For i:=1 to 6 do
     If(b[i]=0)and((a[c1,1]=a[i,1])or(a[c1,1]=a[i,2]))Then
     Begin
      c2:=i;
      b[i]:=1;
      break;
     End;
    For i:=1 to 6 do
     If(b[i]=0)and((a[c1,2]=a[i,1])or(a[c1,2]=a[i,2]))Then
     Begin
      c3:=i;
      b[i]:=1;
      break;
     End;
   End;
   If(c1=0)or(c2=0)or(c3=0)Then ans:=false else
   If(a[c1,1]=a[c2,1])Then
   If(a[c2,2]<>a[c3,1])Then
    ans:=false;
  End;}
 End;
{--------------------------------------------------------------------------}
 Procedure Save;
 Begin
  assign(output,'box.out');
  rewrite(output);
  If ans Then
  Begin
   write('POSSIBLE')
  End
  Else
   write('IMPOSSIBLE');
  close(output);
 End;
{--------------------------------------------------------------------------}
 BEGIN
  Load;
  Solve;
  Save;
 END.
