#coding:utf-8
n = int(input())
numbers = list(map(int,input().split()))

print(*numbers)

for i in range(1,n):
    tmp = numbers[i]
    j = i - 1

    while j >= 0 and numbers[j] > tmp:
        numbers[j+1] = numbers[j]
        j -= 1
    numbers[j+1] = tmp

    print(*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(*numbers) print *numbers numbers for i in range(1,n):
    tmp = numbers[i]
    j = i - 1

    while j >= 0 and numbers[j] > tmp:
        numbers[j+1] = numbers[j]
        j -= 1
    numbers[j+1] = tmp

    print(*numbers) i range(1,n) range 1 n tmp = numbers[i] tmp numbers[i] numbers i j = i - 1 j i - 1 i 1 while j >= 0 and numbers[j] > tmp:
        numbers[j+1] = numbers[j]
        j -= 1
     j >= 0 and numbers[j] > tmp j >= 0 j 0 numbers[j] > tmp numbers[j] numbers j tmp numbers[j+1] = numbers[j] numbers[j+1] numbers j+1 j 1 numbers[j] numbers j j -= 1 j 1 numbers[j+1] = tmp numbers[j+1] numbers j+1 j 1 tmp print(*numbers) print *numbers numbers tmp = numbers[i] numbers[i] tmp j -= 1 1 j n = int(input()) int(input()) n numbers = list(map(int,input().split())) list(map(int,input().split())) numbers j = i - 1 i - 1 j
#coding:utf-8
n = int(input())
numbers = list(map(int,input().split()))

print(*numbers)

for i in range(1,n):
    tmp = numbers[i]
    j = i - 1

    while j >= 0 and numbers[j] > tmp:
        numbers[j+1] = numbers[j]
        j -= 1
    numbers[j+1] = tmp

    print(*numbers)