N = int(input())
A = list(map(int,input().split()))

def insertionSort(A,N):
    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

        outputNum(A)

def outputNum(A):
    tmp = map(str,A)
    text = " ".join(tmp)
    print(text)

outputNum(A)
insertionSort(A,N)
 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 def insertionSort(A,N):
    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

        outputNum(A) insertionSort 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

        outputNum(A) 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 outputNum(A) outputNum A A A N N def outputNum(A):
    tmp = map(str,A)
    text = " ".join(tmp)
    print(text) outputNum tmp = map(str,A) tmp map(str,A) map str A text = " ".join(tmp) text " ".join(tmp) " ".join " " join tmp print(text) print text A A outputNum(A) outputNum A insertionSort(A,N) insertionSort A N N = int(input()) int(input()) N def insertionSort(A,N):
    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

        outputNum(A) def insertionSort(A,N):
    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

        outputNum(A) insertionSort A = list(map(int,input().split())) list(map(int,input().split())) A def outputNum(A):
    tmp = map(str,A)
    text = " ".join(tmp)
    print(text) def outputNum(A):
    tmp = map(str,A)
    text = " ".join(tmp)
    print(text) outputNum
N = int(input())
A = list(map(int,input().split()))

def insertionSort(A,N):
    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

        outputNum(A)

def outputNum(A):
    tmp = map(str,A)
    text = " ".join(tmp)
    print(text)

outputNum(A)
insertionSort(A,N)

