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

print(' '.join(str(x) for x in numbers))
for i in range(1, n):
    key = numbers[i]
    j = i - 1
    while 0 <= j and key < numbers[j]:
        numbers[j+1] = numbers[j]
        j -= 1
    numbers[j+1] = key
    print(' '.join(str(x) for x in numbers)) n = int(input()) n int(input()) int input() input numbers = list(map(int, input().split())) numbers list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print(' '.join(str(x) for x in numbers)) print ' '.join(str(x) for x in numbers) ' '.join ' ' join str(x) str x for i in range(1, n):
    key = numbers[i]
    j = i - 1
    while 0 <= j and key < numbers[j]:
        numbers[j+1] = numbers[j]
        j -= 1
    numbers[j+1] = key
    print(' '.join(str(x) for x in numbers)) i range(1, n) range 1 n key = numbers[i] key numbers[i] numbers i j = i - 1 j i - 1 i 1 while 0 <= j and key < numbers[j]:
        numbers[j+1] = numbers[j]
        j -= 1
     0 <= j and key < numbers[j] 0 <= j 0 j key < numbers[j] key numbers[j] numbers j numbers[j+1] = numbers[j] numbers[j+1] numbers j+1 j 1 numbers[j] numbers j j -= 1 j 1 numbers[j+1] = key numbers[j+1] numbers j+1 j 1 key print(' '.join(str(x) for x in numbers)) print ' '.join(str(x) for x in numbers) ' '.join ' ' join str(x) str x key = numbers[i] numbers[i] key numbers = list(map(int, input().split())) list(map(int, input().split())) numbers n = int(input()) int(input()) n j = i - 1 i - 1 j j -= 1 1 j
n = int(input())
numbers = list(map(int, input().split()))

print(' '.join(str(x) for x in numbers))
for i in range(1, n):
    key = numbers[i]
    j = i - 1
    while 0 <= j and key < numbers[j]:
        numbers[j+1] = numbers[j]
        j -= 1
    numbers[j+1] = key
    print(' '.join(str(x) for x in numbers))