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