def insertionSort(A, N):
    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
        t = str(A[0])
        for i in range(1,N):
            t = t + " " + str(A[i])
        print(t)


             
n = int(input())
a = [int(i) for i in input().split()]

insertionSort(a,n) def insertionSort(A, N):
    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
        t = str(A[0])
        for i in range(1,N):
            t = t + " " + str(A[i])
        print(t)


              insertionSort 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
        t = str(A[0])
        for i in range(1,N):
            t = t + " " + str(A[i])
        print(t)


              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 t = str(A[0]) t str(A[0]) str A[0] A 0 for i in range(1,N):
            t = t + " " + str(A[i])
         i range(1,N) range 1 N t = t + " " + str(A[i]) t t + " " + str(A[i]) t + " " t " " str(A[i]) str A[i] A i print(t) print t A A N N n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = [int(i) for i in input().split()] a [int(i) for i in input().split()] insertionSort(a,n) insertionSort a n a = [int(i) for i in input().split()] [int(i) for i in input().split()] a def insertionSort(A, N):
    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
        t = str(A[0])
        for i in range(1,N):
            t = t + " " + str(A[i])
        print(t)


              def insertionSort(A, N):
    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
        t = str(A[0])
        for i in range(1,N):
            t = t + " " + str(A[i])
        print(t)


              insertionSort n = int(input()) int(input()) n
def insertionSort(A, N):
    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
        t = str(A[0])
        for i in range(1,N):
            t = t + " " + str(A[i])
        print(t)


             
n = int(input())
a = [int(i) for i in input().split()]

insertionSort(a,n)