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()) N int(input()) int input() input int(A) for A in input().split() for A in input().split() A input().split() ().split () input split for A in input().split() int(A) int A A = [int(A) for A in input().split()] 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 = " ") k range(N) range N if k == N -1:
        print("{}".format(A[k]))
    else:
        print("{}".format(A[k]), end = " ") k == N -1 k N -1 N 1 print("{}".format(A[k])) print "{}".format(A[k]) "{}".format "{}" format A[k] A k print("{}".format(A[k]), end = " ") print "{}".format(A[k]) "{}".format "{}" format A[k] A k end = " " 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 = " ") i range(1, N) range 1 N j = i -1 j i -1 i 1 v = A[i] v A[i] A i 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 for k in range(N):
        if k == N -1:
            print("{}".format(A[k]))
        else:
            print("{}".format(A[k]), end = " ") k range(N) range N if k == N -1:
            print("{}".format(A[k]))
        else:
            print("{}".format(A[k]), end = " ") k == N -1 k N -1 N 1 print("{}".format(A[k])) print "{}".format(A[k]) "{}".format "{}" format A[k] A k print("{}".format(A[k]), end = " ") print "{}".format(A[k]) "{}".format "{}" format A[k] A k end = " " end " " j -= 1 1 j v = A[i] A[i] v N = int(input()) int(input()) N A = [int(A) for A in input().split()] [int(A) for A in input().split()] A j = i -1 i -1 j
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 = " ")