#include<bits/stdc++.h>
using namespace std;
const int maxx = 100000 + 10;
int Heap[maxx];
int main() {
int n,num = 0,x;
scanf("%d",&n);
for(int i=1; i<=n; i++)
scanf("%d",&x),Heap[++num]=x,push_heap(Heap+1,Heap+num+1,greater<int>());
for(int i=1; i<=n; i++)
printf("%d ",Heap[1]),pop_heap(Heap+1,Heap+num+1,greater<int>()),num--;
return 0;
}