#include <stdio.h>
int main(){
  int res[],n,flag,j,count,i;
  scanf("%d",&n);
  scanf("%d",res[n]);
  flag = 1;
  i=0;
  while(flag){
    flag = 0;
    for(j=n-1;j<=i+1;j++){
      if(res[j]<res[j-1]){
	res[j] = res[j-1];
	flag = 1;
	
      }
      i++;
    }
    return 0;
  }