def sort(A):
    for i in range(0, len(A) - 1):
        modify_order(A, i)
        print(A);print()

def modify_order(A, i):
    for j in reversed(range(i + 1, len(A))):
        print(A)
        if A[j - 1] > A[j]:
            A[j - 1], A[j] = A[j], A[j - 1]
