def insertionSort(A, N):
    for i in xrange(1, N):
        printList(A, 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
    return A

def printList(A, N):
    for i in xrange(N):
        print A[i],
    print

# MAIN
N = input()
A = map(int, raw_input().split())

A = insertionSort(A, N)
printList(A, N) def insertionSort(A, N):
    for i in xrange(1, N):
        printList(A, 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
    return A insertionSort for i in xrange(1, N):
        printList(A, 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
     i xrange(1, N) xrange 1 N printList(A, N) printList A 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 return A A A A N N def printList(A, N):
    for i in xrange(N):
        print A[i],
    print

# MAIN printList for i in xrange(N):
        print A[i],
     i xrange(N) xrange N print A[i] A i print A A N N N = input() N input() input A = map(int, raw_input().split()) A map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split A = insertionSort(A, N) A insertionSort(A, N) insertionSort A N printList(A, N) printList A N def printList(A, N):
    for i in xrange(N):
        print A[i],
    print

# MAIN def printList(A, N):
    for i in xrange(N):
        print A[i],
    print

# MAIN printList def insertionSort(A, N):
    for i in xrange(1, N):
        printList(A, 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
    return A def insertionSort(A, N):
    for i in xrange(1, N):
        printList(A, 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
    return A insertionSort A = map(int, raw_input().split()) map(int, raw_input().split()) A N = input() input() N A = insertionSort(A, N) insertionSort(A, N) A
def insertionSort(A, N):
    for i in xrange(1, N):
        printList(A, 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
    return A

def printList(A, N):
    for i in xrange(N):
        print A[i],
    print

# MAIN
N = input()
A = map(int, raw_input().split())

A = insertionSort(A, N)
printList(A, N)