#include<stdio.h>

signed main(){
int i,nn[100],x,n,k,m;
scanf("%d %d",&x,&n);
 scanf("%ls",nn);
  
  k=x;
i=0;  
while(i<=100){
x=k;
x=x-i+1;
for(m=0;nn[m]=='\0';m++){
if(nn[m]!=x){
printf("%d\n",x);
  break;
} 
}  
x=x+i+1;  
x=x+i+1;
for(m=0;nn[m]=='\0';m++){
if(nn[m]!=x){
printf("%d\n",x);
  break;
} 
}  
 x=x-i+1; 
i++;
}




return 0;
}