n = input()
A = [int(i) for i in input().split(' ')]

def trace(A):
    for index, v in enumerate(A):
        print(v, end='')
        if index != len(A) - 1:
            print(' ', end='')
    print()

trace(A)
for i in range(1, len(A)):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = v
    trace(A) n = input() n input() input int(i) for i in input().split(' ') for i in input().split(' ') i input().split(' ') ().split () input split ' ' for i in input().split(' ') int(i) int i A = [int(i) for i in input().split(' ')] A [int(i) for i in input().split(' ')] def trace(A):
    for index, v in enumerate(A):
        print(v, end='')
        if index != len(A) - 1:
            print(' ', end='')
    print() trace for index, v in enumerate(A):
        print(v, end='')
        if index != len(A) - 1:
            print(' ', end='')
     index v enumerate(A) enumerate A print(v, end='') print v end='' end '' if index != len(A) - 1:
            print(' ', end='')
     index != len(A) - 1 index len(A) - 1 len(A) len A 1 print(' ', end='') print ' ' end='' end '' print() print A A trace(A) trace A for i in range(1, len(A)):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = v
    trace(A) i range(1, len(A)) range 1 len(A) len A v = A[i] v A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
     j >= 0 and A[j] > v j >= 0 j 0 A[j] > v A[j] A j v A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = v A[j+1] A j+1 j 1 v trace(A) trace A j = i - 1 i - 1 j j -= 1 1 j A = [int(i) for i in input().split(' ')] [int(i) for i in input().split(' ')] A def trace(A):
    for index, v in enumerate(A):
        print(v, end='')
        if index != len(A) - 1:
            print(' ', end='')
    print() def trace(A):
    for index, v in enumerate(A):
        print(v, end='')
        if index != len(A) - 1:
            print(' ', end='')
    print() trace n = input() input() n v = A[i] A[i] v
n = input()
A = [int(i) for i in input().split(' ')]

def trace(A):
    for index, v in enumerate(A):
        print(v, end='')
        if index != len(A) - 1:
            print(' ', end='')
    print()

trace(A)
for i in range(1, len(A)):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = v
    trace(A)