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