#include<stdio.h>
#define N 36

struct kazu {
  int value;
}

main(){
  int i,j,n,a[N],b,d[N],e;
  struct kazu c;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",a[i]);
    d[i] = a[i];
  }

  for(i=0;i<n-1;i++){
    minj = i;
    for(j=n-1;j<0;j--){
      if(c[j].value < c[minj].value){
	minj = j;
      }
      b = c[j].value;
      c[j].value = c[j-1].value;
      c[minj].value = b;
    }
  }
 
  for(i=0;i<n-1;i++){
    minj = i;
    for(j=i;j<n-1;j++){
      if(c[j].value < c[minj].value){
	minj = j;
      }
      e = c[j].value;
      c[j].value = c[j-1].value;
      c[minj].value = b;
    }
  }
  return 0;
}

   