def insertionSort(a, n):
    for i in range(1, n):
        show(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
    else:
        show(a, n)

def show(a, n):
    for i in range(n):
        if i == n-1:
            print "%d" % a[i]
        else:
            print "%d" % a[i],

n = input()
a = map(int, raw_input().split())
insertionSort(a, n) def insertionSort(a, n):
    for i in range(1, n):
        show(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
    else:
        show(a, n) insertionSort for i in range(1, n):
        show(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
    else:
        show(a, n) i range(1, n) range 1 n show(a, n) show 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 show(a, n) show a n a a n n def show(a, n):
    for i in range(n):
        if i == n-1:
            print "%d" % a[i]
        else:
            print "%d" % a[i], show for i in range(n):
        if i == n-1:
            print "%d" % a[i]
        else:
            print "%d" % a[i], i range(n) range n if i == n-1:
            print "%d" % a[i]
        else:
            print "%d" % a[i], i == n-1 i n-1 n 1 print "%d" % a[i] "%d" a[i] a i print "%d" % a[i] "%d" a[i] a i 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 insertionSort(a, n) insertionSort a n def insertionSort(a, n):
    for i in range(1, n):
        show(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
    else:
        show(a, n) def insertionSort(a, n):
    for i in range(1, n):
        show(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
    else:
        show(a, n) insertionSort n = input() input() n a = map(int, raw_input().split()) map(int, raw_input().split()) a def show(a, n):
    for i in range(n):
        if i == n-1:
            print "%d" % a[i]
        else:
            print "%d" % a[i], def show(a, n):
    for i in range(n):
        if i == n-1:
            print "%d" % a[i]
        else:
            print "%d" % a[i], show
def insertionSort(a, n):
    for i in range(1, n):
        show(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
    else:
        show(a, n)

def show(a, n):
    for i in range(n):
        if i == n-1:
            print "%d" % a[i]
        else:
            print "%d" % a[i],

n = input()
a = map(int, raw_input().split())
insertionSort(a, n)