from random import shuffle
def partition(unsort,s,e):
i = s-1
pivot = unsort[e]
for j in range(s,e):
if unsort[j] <= pivot:
i+=1
unsort[i],unsort[j] = unsort[j],unsort[i]
unsort[i+1],unsort[e] = unsort[e],unsort[i+1]
return i+1
def quicksort(unsort,s,e):
if s>=e:
return
p = partition(unsort,s,e)
quicksort(unsort,s,p-1)
quicksort(unsort,p+1,e)
t = int(input())
unsort = [int(x) for x in input().split()]
shuffle(unsort)
quicksort(unsort,0,t-1)
for item in unsort:
print(item,end=’ ')