import heapq  # heapqライブラリのimoprt
N = int(input())
A = []

for i in range(N):
 a = int(input())
 A.append(-a)

A_init = A[:]
for i in range(N):
  A[i] = 0
  heapq.heapify(A)  # リストを優先度付きキューへ
  ans = -heapq.heappop(A) # 最小値の取り出し
  print(ans)
  A = A_init[:]