#include <stdio.h>
#define MAX 1000000000


void marge(int *,int,int,int);
void margeSort(int *,int,int);

void merge(int *A,int left,int mid,int right){

	int i,j,k,x,y;

	x = mid - left;
	y = right - mid;
	int n1[x],n2[y],L[x],R[y];


	for(i = 0; i < x; i++) L[i] = A[left + i];
  	for(i = 0; i < y; i++) R[i] = A[mid + i];

  	L[x] = MAX;
  	R[y] = MAX;
  	i = 0;
  	j = 0;

  	for(k = left; k < right-1; k++){
    	if(L[i] <= R[j]){
      	A[k] = L[i];
      	i = i + 1;
    	}else{ 
      	A[k] = R[j];
      	j = j + 1;
  		}
	}
}

void mergeSort(int *A,int left,int right){

	int mid;

  	if(left+1 < right) mid = (left + right)/2;
    mergeSort(A,left,mid);
    mergeSort(A,mid,right);
    merge(A,left,mid,right);
}


int main(){

	int i,n,A[MAX];

	scanf("%d",&n);
	for(i = 0; i < n; i++) scanf("%d",&A[i]);
	margeSort(A,0,n-1);
}