n = int(input()) A = list(map(int,input().split())) for i in range(1,2 * n - 3): for p in range(i // 2 + 1): q = i - p if q < n and A[p] > A[q]: A[p],A[q] = A[q],A[p] print(" ".join(map(str,A)))