def insertionSort(R, n):
    for i in range(1, n):
        Now = R[i]
        j = i - 1
        while j >= 0 and R[j] > Now:
            R[j + 1] = R[j]
            j = j - 1
        R[j + 1] = Now
        trace(R, n)

def trace(R, n):
    for i in range(n):
        print R[i],
    print

n = input()
R = map(int, raw_input().split())

trace(R, n)
insertionSort(R, n) def insertionSort(R, n):
    for i in range(1, n):
        Now = R[i]
        j = i - 1
        while j >= 0 and R[j] > Now:
            R[j + 1] = R[j]
            j = j - 1
        R[j + 1] = Now
        trace(R, n) insertionSort for i in range(1, n):
        Now = R[i]
        j = i - 1
        while j >= 0 and R[j] > Now:
            R[j + 1] = R[j]
            j = j - 1
        R[j + 1] = Now
        trace(R, n) i range(1, n) range 1 n Now = R[i] Now R[i] R i j = i - 1 j i - 1 i 1 while j >= 0 and R[j] > Now:
            R[j + 1] = R[j]
            j = j - 1
         j >= 0 and R[j] > Now j >= 0 j 0 R[j] > Now R[j] R j Now R[j + 1] = R[j] R[j + 1] R j + 1 j 1 R[j] R j j = j - 1 j j - 1 j 1 R[j + 1] = Now R[j + 1] R j + 1 j 1 Now trace(R, n) trace R n R R n n def trace(R, n):
    for i in range(n):
        print R[i],
    print trace for i in range(n):
        print R[i],
     i range(n) range n print R[i] R i print R R n n n = input() n input() input R = map(int, raw_input().split()) R map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split trace(R, n) trace R n insertionSort(R, n) insertionSort R n def insertionSort(R, n):
    for i in range(1, n):
        Now = R[i]
        j = i - 1
        while j >= 0 and R[j] > Now:
            R[j + 1] = R[j]
            j = j - 1
        R[j + 1] = Now
        trace(R, n) def insertionSort(R, n):
    for i in range(1, n):
        Now = R[i]
        j = i - 1
        while j >= 0 and R[j] > Now:
            R[j + 1] = R[j]
            j = j - 1
        R[j + 1] = Now
        trace(R, n) insertionSort R = map(int, raw_input().split()) map(int, raw_input().split()) R n = input() input() n def trace(R, n):
    for i in range(n):
        print R[i],
    print def trace(R, n):
    for i in range(n):
        print R[i],
    print trace
def insertionSort(R, n):
    for i in range(1, n):
        Now = R[i]
        j = i - 1
        while j >= 0 and R[j] > Now:
            R[j + 1] = R[j]
            j = j - 1
        R[j + 1] = Now
        trace(R, n)

def trace(R, n):
    for i in range(n):
        print R[i],
    print

n = input()
R = map(int, raw_input().split())

trace(R, n)
insertionSort(R, n)