def insertionSort(N,A): 
    for i in range(0,N):
        innum = A[i]
        j = i - 1
        while j>=0 and innum < A[j]:
            A[j+1] = A[j]
            j = j -1
        A[j+1] = innum
        for j in range(0,N):
            if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
    return A

if __name__ == "__main__":
    N = input()
    N = int(N)
    A = input()
    A = A.split()
    for i in range(0,N):
        A[i] = int(A[i])
    insertionSort(N,A) def insertionSort(N,A): 
    for i in range(0,N):
        innum = A[i]
        j = i - 1
        while j>=0 and innum < A[j]:
            A[j+1] = A[j]
            j = j -1
        A[j+1] = innum
        for j in range(0,N):
            if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
    return A insertionSort for i in range(0,N):
        innum = A[i]
        j = i - 1
        while j>=0 and innum < A[j]:
            A[j+1] = A[j]
            j = j -1
        A[j+1] = innum
        for j in range(0,N):
            if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
     i range(0,N) range 0 N innum = A[i] innum A[i] A i j = i - 1 j i - 1 i 1 while j>=0 and innum < A[j]:
            A[j+1] = A[j]
            j = j -1
         j>=0 and innum < A[j] j>=0 j 0 innum < A[j] innum A[j] A j 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] = innum A[j+1] A j+1 j 1 innum for j in range(0,N):
            if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
     j range(0,N) range 0 N if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
     j < N-1 j N-1 N 1 print(A[j], end=" ") print A[j] A j end=" " end " " print(A[j]) print A[j] A j return A A N N A A if __name__ == "__main__":
    N = input()
    N = int(N)
    A = input()
    A = A.split()
    for i in range(0,N):
        A[i] = int(A[i])
    insertionSort(N,A) __name__ == "__main__" __name__ "__main__" N = input() N input() input N = int(N) N int(N) int N A = input() A input() input A = A.split() A A.split() A.split A split for i in range(0,N):
        A[i] = int(A[i])
     i range(0,N) range 0 N A[i] = int(A[i]) A[i] A i int(A[i]) int A[i] A i insertionSort(N,A) insertionSort N A def insertionSort(N,A): 
    for i in range(0,N):
        innum = A[i]
        j = i - 1
        while j>=0 and innum < A[j]:
            A[j+1] = A[j]
            j = j -1
        A[j+1] = innum
        for j in range(0,N):
            if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
    return A def insertionSort(N,A): 
    for i in range(0,N):
        innum = A[i]
        j = i - 1
        while j>=0 and innum < A[j]:
            A[j+1] = A[j]
            j = j -1
        A[j+1] = innum
        for j in range(0,N):
            if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
    return A insertionSort N = int(N) int(N) N A = input() input() A N = input() input() N A = A.split() A.split() A
def insertionSort(N,A): 
    for i in range(0,N):
        innum = A[i]
        j = i - 1
        while j>=0 and innum < A[j]:
            A[j+1] = A[j]
            j = j -1
        A[j+1] = innum
        for j in range(0,N):
            if j < N-1:
                print(A[j], end=" ")
            else:
                print(A[j])

    
    return A

if __name__ == "__main__":
    N = input()
    N = int(N)
    A = input()
    A = A.split()
    for i in range(0,N):
        A[i] = int(A[i])
    insertionSort(N,A)