
def insertionSort(S, N):
    for i in range(N):
        v = S[i]
        j = i-1
        while j >= 0 and S[j] > v:
            S[j+1] = S[j]
            j = j-1
        S[j+1] = v
        
        print(' '.join(map(str, S)))
        
        
n = int(input())
s = list(map(int, input().split()))
insertionSort(s, n) def insertionSort(S, N):
    for i in range(N):
        v = S[i]
        j = i-1
        while j >= 0 and S[j] > v:
            S[j+1] = S[j]
            j = j-1
        S[j+1] = v
        
        print(' '.join(map(str, S)))
        
         insertionSort for i in range(N):
        v = S[i]
        j = i-1
        while j >= 0 and S[j] > v:
            S[j+1] = S[j]
            j = j-1
        S[j+1] = v
        
        print(' '.join(map(str, S)))
        
         i range(N) range N v = S[i] v S[i] S i j = i-1 j i-1 i 1 while j >= 0 and S[j] > v:
            S[j+1] = S[j]
            j = j-1
         j >= 0 and S[j] > v j >= 0 j 0 S[j] > v S[j] S j v S[j+1] = S[j] S[j+1] S j+1 j 1 S[j] S j j = j-1 j j-1 j 1 S[j+1] = v S[j+1] S j+1 j 1 v print(' '.join(map(str, S))) print ' '.join(map(str, S)) ' '.join ' ' join map(str, S) map str S S S N N n = int(input()) n int(input()) int input() input s = list(map(int, input().split())) s list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertionSort(s, n) insertionSort s n s = list(map(int, input().split())) list(map(int, input().split())) s def insertionSort(S, N):
    for i in range(N):
        v = S[i]
        j = i-1
        while j >= 0 and S[j] > v:
            S[j+1] = S[j]
            j = j-1
        S[j+1] = v
        
        print(' '.join(map(str, S)))
        
         def insertionSort(S, N):
    for i in range(N):
        v = S[i]
        j = i-1
        while j >= 0 and S[j] > v:
            S[j+1] = S[j]
            j = j-1
        S[j+1] = v
        
        print(' '.join(map(str, S)))
        
         insertionSort n = int(input()) int(input()) n

def insertionSort(S, N):
    for i in range(N):
        v = S[i]
        j = i-1
        while j >= 0 and S[j] > v:
            S[j+1] = S[j]
            j = j-1
        S[j+1] = v
        
        print(' '.join(map(str, S)))
        
        
n = int(input())
s = list(map(int, input().split()))
insertionSort(s, n)
