def insertionSort(n, A):
    for i in range(n):
        t = A[i]
        j = i - 1
        while (j >= 0) and (A[j] > t):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = t
        print(*A)
    return A


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    insertionSort(N, A) def insertionSort(n, A):
    for i in range(n):
        t = A[i]
        j = i - 1
        while (j >= 0) and (A[j] > t):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = t
        print(*A)
    return A insertionSort for i in range(n):
        t = A[i]
        j = i - 1
        while (j >= 0) and (A[j] > t):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = t
        print(*A)
     i range(n) range n t = A[i] t A[i] A i j = i - 1 j i - 1 i 1 while (j >= 0) and (A[j] > t):
            A[j + 1] = A[j]
            j -= 1
         (j >= 0) and (A[j] > t) j >= 0 j 0 A[j] > t A[j] A j t A[j + 1] = A[j] A[j + 1] A j + 1 j 1 A[j] A j j -= 1 j 1 A[j + 1] = t A[j + 1] A j + 1 j 1 t print(*A) print *A A return A A n n A A if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    insertionSort(N, A) __name__ == '__main__' __name__ '__main__' N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertionSort(N, A) insertionSort N A N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A def insertionSort(n, A):
    for i in range(n):
        t = A[i]
        j = i - 1
        while (j >= 0) and (A[j] > t):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = t
        print(*A)
    return A def insertionSort(n, A):
    for i in range(n):
        t = A[i]
        j = i - 1
        while (j >= 0) and (A[j] > t):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = t
        print(*A)
    return A insertionSort
def insertionSort(n, A):
    for i in range(n):
        t = A[i]
        j = i - 1
        while (j >= 0) and (A[j] > t):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = t
        print(*A)
    return A


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    insertionSort(N, A)