def insertionSort(A, N):
    for i in range(1, N):
        print (*A)
        v = A[i]
        j = i - 1
        while j>= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
    return A


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

    print (*insertionSort(A, N)) def insertionSort(A, N):
    for i in range(1, N):
        print (*A)
        v = A[i]
        j = i - 1
        while j>= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
    return A insertionSort for i in range(1, N):
        print (*A)
        v = A[i]
        j = i - 1
        while j>= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
     i range(1, N) range 1 N print (*A) print *A A 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 return A A A A N N if __name__ == "__main__":
    N = int(input())
    A = [int(i) for i in input().split()]

    print (*insertionSort(A, N)) __name__ == "__main__" __name__ "__main__" 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()] print (*insertionSort(A, N)) print *insertionSort(A, N) insertionSort(A, N) insertionSort A N def insertionSort(A, N):
    for i in range(1, N):
        print (*A)
        v = A[i]
        j = i - 1
        while j>= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
    return A def insertionSort(A, N):
    for i in range(1, N):
        print (*A)
        v = A[i]
        j = i - 1
        while j>= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
    return A insertionSort N = int(input()) int(input()) 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(1, N):
        print (*A)
        v = A[i]
        j = i - 1
        while j>= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
    return A


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

    print (*insertionSort(A, N))