from itertools import combinations as cmb N = int(input()) As = [int(x) for x in input().split()] for i in range(2 * N - 3): for p in range(i + 1): q = i - p if 0 <= p and p < q and q <= N - 1: if As[p] > As[q]: tmp = As[p] As[p] = As[q] As[q] = tmp print(" ".join(map(str,As)))