size = int(input())
element = list(map(int,input().split()))
print(" ".join(map(str,element)))


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


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