# 3.2
# input
N = int(input())
#a = [(input()) for i in range(N)]
a = list(map(int, input().split())) # "1 2 3"??¨??\???
print(" ".join(map(str, a)))

for i in range(1, N):
    tmp = a[i]
    j = i - 1
    while j >= 0 and a[j] > tmp:
        a[j + 1] = a[j]
        j -= 1
    
    a[j + 1] = tmp
    print(" ".join(map(str, a))) N = int(input()) N int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print(" ".join(map(str, a))) print " ".join(map(str, a)) " ".join " " join map(str, a) map str a for i in range(1, N):
    tmp = a[i]
    j = i - 1
    while j >= 0 and a[j] > tmp:
        a[j + 1] = a[j]
        j -= 1
    
    a[j + 1] = tmp
    print(" ".join(map(str, a))) i range(1, N) range 1 N tmp = a[i] tmp a[i] a i j = i - 1 j i - 1 i 1 while j >= 0 and a[j] > tmp:
        a[j + 1] = a[j]
        j -= 1
    
     j >= 0 and a[j] > tmp j >= 0 j 0 a[j] > tmp a[j] a j tmp a[j + 1] = a[j] a[j + 1] a j + 1 j 1 a[j] a j j -= 1 j 1 a[j + 1] = tmp a[j + 1] a j + 1 j 1 tmp print(" ".join(map(str, a))) print " ".join(map(str, a)) " ".join " " join map(str, a) map str a j = i - 1 i - 1 j tmp = a[i] a[i] tmp N = int(input()) int(input()) N a = list(map(int, input().split())) list(map(int, input().split())) a j -= 1 1 j
# 3.2
# input
N = int(input())
#a = [(input()) for i in range(N)]
a = list(map(int, input().split())) # "1 2 3"??¨??\???
print(" ".join(map(str, a)))

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