N = int(input())

A = list(map(int, input().split()))



for k in range(N):

    if k == N - 1:

        print(str(A[k]))

    else:    

        print(str(A[k]) + " ", end="")



for i in range(1, N):

    v = A[i]

    j = i - 1

    while j >= 0 and A[j] > v:

        A[j + 1] = A[j]

        j -= 1

    A[j+1] = v

    for k in range(N):

        if k == N - 1:

            print(str(A[k]))

        else:    

            print(str(A[k]) + " ", end="")

            

N = int(input())

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

for k in range(N):

    if k == N -1:

        print("{}".format(A[k]))

    else:

        print("{}".format(A[k]), end = " ")

for i in range(1, N):

    j = i -1

    v = A[i]

    while j >= 0 and A[j] > v:

        A[j+1] = A[j]

        j -= 1

    A[j+1] = v

    for k in range(N):

        if k == N -1:

            print("{}".format(A[k]))

        else:

            print("{}".format(A[k]), end = " ")

N = int(input())
A = list(map(int, input().split()))
for k in range(N):
    if k == N - 1:
        print(str(A[k]))
    else:
        print(str(A[k]) + " ", end="")
for i in range(1, N):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j + 1] = A[j]
        j -= 1
    A[j + 1] = v
    for k in range(N):
        if k == N - 1:
            print(str(A[k]))
        else:
            print(str(A[k]) + " ", end="")

N = int(input())
A = [int(A) for A in input().split()]
for k in range(N):
    if k == N - 1:
        print("{}".format(A[k]))
    else:
        print("{}".format(A[k]), end=" ")
for i in range(1, N):
    j = i - 1
    v = A[i]
    while j >= 0 and A[j] > v:
        A[j + 1] = A[j]
        j -= 1
    A[j + 1] = v
    for k in range(N):
        if k == N - 1:
            print("{}".format(A[k]))
        else:
            print("{}".format(A[k]), end=" ")

-A = list(map(int, input().split())) +A = [int(A) for A in input().split()] -        print(str(A[k])) +        print("{}".format(A[k])) -        print(str(A[k]) + " ", end="") +        print("{}".format(A[k]), end=" ") +    j = i - 1 -    j = i - 1 -            print(str(A[k])) +            print("{}".format(A[k])) -            print(str(A[k]) + " ", end="") +            print("{}".format(A[k]), end=" ")