n = int(input())
lst = list(map(int,input().split()))

def pri(lst):
    for i in range(len(lst)-1):
        print(lst[i],end=" ")
    print(lst[-1])

pri(lst)
for i in range(1,n):
    v = lst[i]
    j = i-1
    while True:
        if j < 0:
            lst[0] = v
            break
        if lst[j] > v:
            lst[j+1] = lst[j]
            j -= 1
        else:
            lst[j+1] = v
            break
    pri(lst)
 n = int(input()) n int(input()) int input() input lst = list(map(int,input().split())) lst list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def pri(lst):
    for i in range(len(lst)-1):
        print(lst[i],end=" ")
    print(lst[-1]) pri for i in range(len(lst)-1):
        print(lst[i],end=" ")
     i range(len(lst)-1) range len(lst)-1 len(lst) len lst 1 print(lst[i],end=" ") print lst[i] lst i end=" " end " " print(lst[-1]) print lst[-1] lst -1 lst lst pri(lst) pri lst for i in range(1,n):
    v = lst[i]
    j = i-1
    while True:
        if j < 0:
            lst[0] = v
            break
        if lst[j] > v:
            lst[j+1] = lst[j]
            j -= 1
        else:
            lst[j+1] = v
            break
    pri(lst) i range(1,n) range 1 n v = lst[i] v lst[i] lst i j = i-1 j i-1 i 1 while True:
        if j < 0:
            lst[0] = v
            break
        if lst[j] > v:
            lst[j+1] = lst[j]
            j -= 1
        else:
            lst[j+1] = v
            break
     True if j < 0:
            lst[0] = v
            break
         j < 0 j 0 lst[0] = v lst[0] lst 0 v break if lst[j] > v:
            lst[j+1] = lst[j]
            j -= 1
        else:
            lst[j+1] = v
            break
     lst[j] > v lst[j] lst j v lst[j+1] = lst[j] lst[j+1] lst j+1 j 1 lst[j] lst j j -= 1 j 1 lst[j+1] = v lst[j+1] lst j+1 j 1 v break pri(lst) pri lst j = i-1 i-1 j lst = list(map(int,input().split())) list(map(int,input().split())) lst def pri(lst):
    for i in range(len(lst)-1):
        print(lst[i],end=" ")
    print(lst[-1]) def pri(lst):
    for i in range(len(lst)-1):
        print(lst[i],end=" ")
    print(lst[-1]) pri j -= 1 1 j v = lst[i] lst[i] v n = int(input()) int(input()) n
n = int(input())
lst = list(map(int,input().split()))

def pri(lst):
    for i in range(len(lst)-1):
        print(lst[i],end=" ")
    print(lst[-1])

pri(lst)
for i in range(1,n):
    v = lst[i]
    j = i-1
    while True:
        if j < 0:
            lst[0] = v
            break
        if lst[j] > v:
            lst[j+1] = lst[j]
            j -= 1
        else:
            lst[j+1] = v
            break
    pri(lst)

