n=int(input()) a=list(map(int,input().split())) while True: ok = False for i in range(1, 2*n-3): for p in range(0, n-1): q = i-p if p >= q or not (0 <= p < n and 0 <= q < n): continue if a[p] > a[q]: a[p],a[q]=a[q],a[p] ok = True if not ok: break print(' '.join(map(str,a)))