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

program Project1;
 {$APPTYPE CONSOLE}
 Var a : array[1..12] of integer;
     b : array[1..6] of byte;
     vse : array[1..100000] 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*2-1],a[i*2]);
  close(input);
 End;
{--------------------------------------------------------------------------}
 Procedure Solve;
 Var i,j,c1,c2,c3 : integer;
 Begin
  fillchar(vse,sizeof(vse),0);
  For i:=1 to 12 do
   Inc(vse[a[i]]);
  ans:=true;
  For i:=1 to 20000 do
   If(vse[i]=0)or(vse[i]=4)or(vse[i]=8)or(vse[i]=12)Then
   Begin
   End
   Else
    ans:=false;
  If ans Then
  Begin
   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*2-1]=a[j*2-1])and(a[i*2]=a[j*2])Then
      Begin
       b[j]:=1;
       break;
       End;
       If(a[i*2]=a[j*2-1])and(a[i*2-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*2-1]=a[c2*2-1])Then
  Begin
   If(a[c1*2]=a[c3*2])Then
   Begin
    If(a[c2*2]=a[c3*2-1])Then
     ans:=true;
   End
   Else
   If(a[c1*2]=a[c3*2-1])Then
    If(a[c2*2]=a[c3*2])Then
     ans:=true;
  End
  Else
  If(a[c1*2-1]=a[c2*2])Then
  Begin
   If(a[c1*2]=a[c3*2])Then
   Begin
    If(a[c2*2-1]=a[c3*2-1])Then
     ans:=true;
   End
   Else
   If(a[c1*2]=a[c3*2-1])Then
    If(a[c2*2-1]=a[c3*2])Then
     ans:=true;
  End
  Else
  If(a[c1*2]=a[c2*2-1])Then
  Begin
   If(a[c1*2-1]=a[c3*2-1])Then
   Begin
    If(a[c2*2]=a[c3*2])Then
     ans:=true;
   End
   Else
   If(a[c1*2-1]=a[c3*2])Then
    If(a[c2*2]=a[c3*2-1])Then
     ans:=true;
  End
  Else
  If(a[c1*2]=a[c2*2])Then
  Begin
   If(a[c1*2-1]=a[c3*2-1])Then
   Begin
    If(a[c2*2-1]=a[c3*2])Then
     ans:=true;
   End
   Else
   If(a[c1*2-1]=a[c3*2])Then
    If(a[c2*2-1]=a[c3*2-1])Then
     ans:=true;
  End;
  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.
