num = int(input())
array = list(map(int,input().split()))

for i in range(num):
    v = array[i]
    j = i-1
    while j >=0 and array[j]>v:
        array[j+1] = array[j]
        j -= 1
    array[j+1] = v
    print(" ".join(map(str,array))) num = int(input()) num int(input()) int input() input array = list(map(int,input().split())) array list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in range(num):
    v = array[i]
    j = i-1
    while j >=0 and array[j]>v:
        array[j+1] = array[j]
        j -= 1
    array[j+1] = v
    print(" ".join(map(str,array))) i range(num) range num v = array[i] v array[i] array i j = i-1 j i-1 i 1 while j >=0 and array[j]>v:
        array[j+1] = array[j]
        j -= 1
     j >=0 and array[j]>v j >=0 j 0 array[j]>v array[j] array j v array[j+1] = array[j] array[j+1] array j+1 j 1 array[j] array j j -= 1 j 1 array[j+1] = v array[j+1] array j+1 j 1 v print(" ".join(map(str,array))) print " ".join(map(str,array)) " ".join " " join map(str,array) map str array v = array[i] array[i] v j -= 1 1 j j = i-1 i-1 j num = int(input()) int(input()) num array = list(map(int,input().split())) list(map(int,input().split())) array
num = int(input())
array = list(map(int,input().split()))

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