N = int(input())
a = [int(x) for x in 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-=1
    a[j+1]=v
    print(*a) N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x a = [int(x) for x in input().split()] a [int(x) for x in 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-=1
    a[j+1]=v
    print(*a) 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-=1
     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-=1 j 1 a[j+1]=v a[j+1] a j+1 j 1 v print(*a) print *a a N = int(input()) int(input()) N v = a[i] a[i] v j = i-1 i-1 j j-=1 1 j a = [int(x) for x in input().split()] [int(x) for x in input().split()] a
N = int(input())
a = [int(x) for x in 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-=1
    a[j+1]=v
    print(*a)