#-*- coding: utf-8 -*-


def insertion_sort(A):
    print ' '.join(map(str, A))
    for i in xrange(1, N, 1):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print ' '.join(map(str, A))
    return A


if __name__ == "__main__":
    N = input()
    A = map(int, raw_input().split())
    result = insertion_sort(A) def insertion_sort(A):
    print ' '.join(map(str, A))
    for i in xrange(1, N, 1):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print ' '.join(map(str, A))
    return A insertion_sort print ' '.join(map(str, A)) ' '.join ' ' join map(str, A) map str A for i in xrange(1, N, 1):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print ' '.join(map(str, A))
     i xrange(1, N, 1) xrange 1 N 1 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 print ' '.join(map(str, A)) ' '.join ' ' join map(str, A) map str A return A A A A if __name__ == "__main__":
    N = input()
    A = map(int, raw_input().split())
    result = insertion_sort(A) __name__ == "__main__" __name__ "__main__" 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 result = insertion_sort(A) result insertion_sort(A) insertion_sort A N = input() input() N A = map(int, raw_input().split()) map(int, raw_input().split()) A def insertion_sort(A):
    print ' '.join(map(str, A))
    for i in xrange(1, N, 1):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print ' '.join(map(str, A))
    return A def insertion_sort(A):
    print ' '.join(map(str, A))
    for i in xrange(1, N, 1):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print ' '.join(map(str, A))
    return A insertion_sort result = insertion_sort(A) insertion_sort(A) result
#-*- coding: utf-8 -*-


def insertion_sort(A):
    print ' '.join(map(str, A))
    for i in xrange(1, N, 1):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print ' '.join(map(str, A))
    return A


if __name__ == "__main__":
    N = input()
    A = map(int, raw_input().split())
    result = insertion_sort(A)