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