number = int(input())
cards = list(map(int, input().split()))


def insertionSort(A, N):
    print(" ".join(map(str, A)))
    for i in range(1, N):
        j = i - 1
        while A[j] > A[i] and j >= 0:
            A[i], A[j] = A[j], A[i]
            j -= 1
            i -= 1
        print(" ".join(map(str, A)))

insertionSort(cards, number) number = int(input()) number int(input()) int input() input cards = list(map(int, input().split())) cards list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def insertionSort(A, N):
    print(" ".join(map(str, A)))
    for i in range(1, N):
        j = i - 1
        while A[j] > A[i] and j >= 0:
            A[i], A[j] = A[j], A[i]
            j -= 1
            i -= 1
        print(" ".join(map(str, A))) insertionSort print(" ".join(map(str, A))) print " ".join(map(str, A)) " ".join " " join map(str, A) map str A for i in range(1, N):
        j = i - 1
        while A[j] > A[i] and j >= 0:
            A[i], A[j] = A[j], A[i]
            j -= 1
            i -= 1
        print(" ".join(map(str, A))) i range(1, N) range 1 N j = i - 1 j i - 1 i 1 while A[j] > A[i] and j >= 0:
            A[i], A[j] = A[j], A[i]
            j -= 1
            i -= 1
         A[j] > A[i] and j >= 0 A[j] > A[i] A[j] A j A[i] A i j >= 0 j 0 A[i], A[j] = A[j], A[i] A[i] A i A[j] A j A[j] A j A[i] A i j -= 1 j 1 i -= 1 i 1 print(" ".join(map(str, A))) print " ".join(map(str, A)) " ".join " " join map(str, A) map str A A A N N insertionSort(cards, number) insertionSort cards number def insertionSort(A, N):
    print(" ".join(map(str, A)))
    for i in range(1, N):
        j = i - 1
        while A[j] > A[i] and j >= 0:
            A[i], A[j] = A[j], A[i]
            j -= 1
            i -= 1
        print(" ".join(map(str, A))) def insertionSort(A, N):
    print(" ".join(map(str, A)))
    for i in range(1, N):
        j = i - 1
        while A[j] > A[i] and j >= 0:
            A[i], A[j] = A[j], A[i]
            j -= 1
            i -= 1
        print(" ".join(map(str, A))) insertionSort number = int(input()) int(input()) number cards = list(map(int, input().split())) list(map(int, input().split())) cards
number = int(input())
cards = list(map(int, input().split()))


def insertionSort(A, N):
    print(" ".join(map(str, A)))
    for i in range(1, N):
        j = i - 1
        while A[j] > A[i] and j >= 0:
            A[i], A[j] = A[j], A[i]
            j -= 1
            i -= 1
        print(" ".join(map(str, A)))

insertionSort(cards, number)
