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