#!/usr/bin/env python
size = int(input())
line = list(map(int, input().split()))

def insertionSort(A, N):
    ans = " ".join(map(str, line))
    print(ans)
    for i in range(1, 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
        ans = " ".join(map(str, line))
        print(ans)

def main():
    insertionSort(line, size)

if __name__ == '__main__':
    main() size = int(input()) size int(input()) int input() input line = list(map(int, input().split())) line list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def insertionSort(A, N):
    ans = " ".join(map(str, line))
    print(ans)
    for i in range(1, 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
        ans = " ".join(map(str, line))
        print(ans) insertionSort ans = " ".join(map(str, line)) ans " ".join(map(str, line)) " ".join " " join map(str, line) map str line print(ans) print ans for i in range(1, 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
        ans = " ".join(map(str, line))
        print(ans) i range(1, N) range 1 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 ans = " ".join(map(str, line)) ans " ".join(map(str, line)) " ".join " " join map(str, line) map str line print(ans) print ans A A N N def main():
    insertionSort(line, size) main insertionSort(line, size) insertionSort line size if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main line = list(map(int, input().split())) list(map(int, input().split())) line def insertionSort(A, N):
    ans = " ".join(map(str, line))
    print(ans)
    for i in range(1, 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
        ans = " ".join(map(str, line))
        print(ans) def insertionSort(A, N):
    ans = " ".join(map(str, line))
    print(ans)
    for i in range(1, 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
        ans = " ".join(map(str, line))
        print(ans) insertionSort def main():
    insertionSort(line, size) def main():
    insertionSort(line, size) main size = int(input()) int(input()) size
#!/usr/bin/env python
size = int(input())
line = list(map(int, input().split()))

def insertionSort(A, N):
    ans = " ".join(map(str, line))
    print(ans)
    for i in range(1, 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
        ans = " ".join(map(str, line))
        print(ans)

def main():
    insertionSort(line, size)

if __name__ == '__main__':
    main()