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