def rren(): return list(map(int, input().split()))
N = int(input())
R = rren()

print(" ".join(map(str, R)))
for i in range(1,N):
    take = R[i]
    j = i-1
    while j >= 0 and R[j] > take:
        R[j+1] = R[j]
        j -= 1
    R[j+1] = take
    print(" ".join(map(str, R))) def rren(): return list(map(int, input().split())) rren N = int(input()) N int(input()) int input() input R = rren() R rren() rren print(" ".join(map(str, R))) print " ".join(map(str, R)) " ".join " " join map(str, R) map str R for i in range(1,N):
    take = R[i]
    j = i-1
    while j >= 0 and R[j] > take:
        R[j+1] = R[j]
        j -= 1
    R[j+1] = take
    print(" ".join(map(str, R))) i range(1,N) range 1 N take = R[i] take R[i] R i j = i-1 j i-1 i 1 while j >= 0 and R[j] > take:
        R[j+1] = R[j]
        j -= 1
     j >= 0 and R[j] > take j >= 0 j 0 R[j] > take R[j] R j take R[j+1] = R[j] R[j+1] R j+1 j 1 R[j] R j j -= 1 j 1 R[j+1] = take R[j+1] R j+1 j 1 take print(" ".join(map(str, R))) print " ".join(map(str, R)) " ".join " " join map(str, R) map str R N = int(input()) int(input()) N j -= 1 1 j def rren(): return list(map(int, input().split())) def rren(): return list(map(int, input().split())) rren j = i-1 i-1 j R = rren() rren() R take = R[i] R[i] take
def rren(): return list(map(int, input().split()))
N = int(input())
R = rren()

print(" ".join(map(str, R)))
for i in range(1,N):
    take = R[i]
    j = i-1
    while j >= 0 and R[j] > take:
        R[j+1] = R[j]
        j -= 1
    R[j+1] = take
    print(" ".join(map(str, R)))