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

def insertion_sort(A, N):
    for i in range(N):
        key = A[i]
        j = i - 1
        while j >= 0 and A[j] > key:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = key

        string = list(map(str, A))
        print(' '.join(string))

insertion_sort(A, N)       N = int(input().rstrip()) N int(input().rstrip()) int input().rstrip() ().rstrip () input rstrip A = list(map(int, input().rstrip().split())) A list(map(int, input().rstrip().split())) list map(int, input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split def insertion_sort(A, N):
    for i in range(N):
        key = A[i]
        j = i - 1
        while j >= 0 and A[j] > key:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = key

        string = list(map(str, A))
        print(' '.join(string)) insertion_sort for i in range(N):
        key = A[i]
        j = i - 1
        while j >= 0 and A[j] > key:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = key

        string = list(map(str, A))
        print(' '.join(string)) i range(N) range N key = A[i] key A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > key:
            A[j+1] = A[j]
            j -= 1
         j >= 0 and A[j] > key j >= 0 j 0 A[j] > key A[j] A j key A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = key A[j+1] A j+1 j 1 key string = list(map(str, A)) string list(map(str, A)) list map(str, A) map str A print(' '.join(string)) print ' '.join(string) ' '.join ' ' join string A A N N insertion_sort(A, N) insertion_sort A N A = list(map(int, input().rstrip().split())) list(map(int, input().rstrip().split())) A def insertion_sort(A, N):
    for i in range(N):
        key = A[i]
        j = i - 1
        while j >= 0 and A[j] > key:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = key

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

        string = list(map(str, A))
        print(' '.join(string)) insertion_sort N = int(input().rstrip()) int(input().rstrip()) N
N = int(input().rstrip())
A = list(map(int, input().rstrip().split()))

def insertion_sort(A, N):
    for i in range(N):
        key = A[i]
        j = i - 1
        while j >= 0 and A[j] > key:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = key

        string = list(map(str, A))
        print(' '.join(string))

insertion_sort(A, N)      
