#include<stdio.h>
#define SENTINEL 10000;

void Merge(int,int,int);
void Merge-Sort(int,int,int);
int count = 0;
int S[SENTINEL]
main(){
int left,right,n;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);

left = 0;
right = n;

Merge-Sort(S[i], left, right);
}
return 0;
}
Merge(A, left, mid, right){
int n1,n2,i,j,k;  
n1 = mid - left;
  n2 = right - mid;
  int array L[n1], R[n2];
  for (i = 0;i< n1;i++){
      L[i] = A[left + i];
}
  for (i = 0;i < n2;i++){
      R[i] = A[mid + i];
}
  L[n1] = SENTINEL
  R[n2] = SENTINEL
  i = 0;
  j = 0;
  for (k = left;k < right;k++){
    if (L[i] <= R[j]){
count++; 
       A[k] = L[i];
        i = i + 1;
}    else {count++;
        A[k] = R[j];
        j = j + 1;
}
return 0;
}

Merge-Sort(A, left, right){
  if (left+1 < right){
      mid = (left + right)/2;
       Merge-Sort(A, left, mid);
       Merge-Sort(A, mid, right);
       Merge(A, left, mid, right);
}
return ;
}