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