n = int(input()) A = list(map(int, input().split())) c = 2 * n - 3 for i in range(c): for p in range(i+1): q = i - p if q <= p: break if q >= n: continue if A[p] > A[q]: A[p], A[q] = A[q], A[p] print(*A)