#include int main(void) { int block[10000]; int L,N,j,k,c,i=0; int a=0; scanf("%d",&L); while(L<1||L>10000){ scanf("%d",&L); } scanf("%d",&N); while(iblock[j]){ k=block[i]; block[i]=block[j]; block[j]=k; } } } if(block[0]>L){ printf("0\n"); } else{ for(i=0;i=L){ c=i;break; } c=N; } } printf("%d\n",c); return 0; }