n = int(input())

a = list(map(int,input().split()))

for i in range(n):
    v = a[i]
    j = i-1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j = j-1
        a[j+1] = v
    for k in range(n):
        if k == n-1:
            print(a[k],end='')
        else:
            print(a[k],end=' ')
    print() 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 for i in range(n):
    v = a[i]
    j = i-1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j = j-1
        a[j+1] = v
    for k in range(n):
        if k == n-1:
            print(a[k],end='')
        else:
            print(a[k],end=' ')
    print() i range(n) range n v = a[i] v a[i] a i j = i-1 j i-1 i 1 while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j = j-1
        a[j+1] = v
     j >= 0 and a[j] > v j >= 0 j 0 a[j] > v a[j] a j v a[j+1] = a[j] a[j+1] a j+1 j 1 a[j] a j j = j-1 j j-1 j 1 a[j+1] = v a[j+1] a j+1 j 1 v for k in range(n):
        if k == n-1:
            print(a[k],end='')
        else:
            print(a[k],end=' ')
     k range(n) range n if k == n-1:
            print(a[k],end='')
        else:
            print(a[k],end=' ')
     k == n-1 k n-1 n 1 print(a[k],end='') print a[k] a k end='' end '' print(a[k],end=' ') print a[k] a k end=' ' end ' ' print() print j = i-1 i-1 j j = j-1 j-1 j v = a[i] a[i] v a = list(map(int,input().split())) list(map(int,input().split())) a n = int(input()) int(input()) n
n = int(input())

a = list(map(int,input().split()))

for i in range(n):
    v = a[i]
    j = i-1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j = j-1
        a[j+1] = v
    for k in range(n):
        if k == n-1:
            print(a[k],end='')
        else:
            print(a[k],end=' ')
    print()