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

print(' '.join(list(map(str, A))))
for i in range(1,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
    print(' '.join(list(map(str, A)))) 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 print(' '.join(list(map(str, A)))) print ' '.join(list(map(str, A))) ' '.join ' ' join list(map(str, A)) list map(str, A) map str A for i in range(1,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
    print(' '.join(list(map(str, A)))) i range(1,n) range 1 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 print(' '.join(list(map(str, A)))) print ' '.join(list(map(str, A))) ' '.join ' ' join list(map(str, A)) list map(str, A) map str A j -= 1 1 j key = A[i] A[i] key n = int(input()) int(input()) n A = list(map(int, input().split())) list(map(int, input().split())) A j = i - 1 i - 1 j
n = int(input())
A = list(map(int, input().split()))

print(' '.join(list(map(str, A))))
for i in range(1,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
    print(' '.join(list(map(str, A))))