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