n = int(input()) a = list(map(int, input().split())) for i in range(1, 2 * n - 3): for p in range(max(i - n + 1, 0), int(i / 2 + 0.5)): q = i - p if a[p] > a[q]: a[p], a[q] = a[q], a[p] for i in a: print(i, end=' ') print('')