#coding:utf-8
#1_1_A
def insertion_sort(cards, n):
    for i in range(n):
        v = cards[i]
        j = i - 1
        while j >= 0 and cards[j] > v:
            cards[j+1] = cards[j]
            j -= 1
        cards[j+1] = v
        print(*cards)

n = int(input())
cards = list(map(int, input().split()))
insertion_sort(cards, n) def insertion_sort(cards, n):
    for i in range(n):
        v = cards[i]
        j = i - 1
        while j >= 0 and cards[j] > v:
            cards[j+1] = cards[j]
            j -= 1
        cards[j+1] = v
        print(*cards) insertion_sort for i in range(n):
        v = cards[i]
        j = i - 1
        while j >= 0 and cards[j] > v:
            cards[j+1] = cards[j]
            j -= 1
        cards[j+1] = v
        print(*cards) i range(n) range n v = cards[i] v cards[i] cards i j = i - 1 j i - 1 i 1 while j >= 0 and cards[j] > v:
            cards[j+1] = cards[j]
            j -= 1
         j >= 0 and cards[j] > v j >= 0 j 0 cards[j] > v cards[j] cards j v cards[j+1] = cards[j] cards[j+1] cards j+1 j 1 cards[j] cards j j -= 1 j 1 cards[j+1] = v cards[j+1] cards j+1 j 1 v print(*cards) print *cards cards cards cards n n n = int(input()) n int(input()) int input() input cards = list(map(int, input().split())) cards list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertion_sort(cards, n) insertion_sort cards n n = int(input()) int(input()) n def insertion_sort(cards, n):
    for i in range(n):
        v = cards[i]
        j = i - 1
        while j >= 0 and cards[j] > v:
            cards[j+1] = cards[j]
            j -= 1
        cards[j+1] = v
        print(*cards) def insertion_sort(cards, n):
    for i in range(n):
        v = cards[i]
        j = i - 1
        while j >= 0 and cards[j] > v:
            cards[j+1] = cards[j]
            j -= 1
        cards[j+1] = v
        print(*cards) insertion_sort cards = list(map(int, input().split())) list(map(int, input().split())) cards
#coding:utf-8
#1_1_A
def insertion_sort(cards, n):
    for i in range(n):
        v = cards[i]
        j = i - 1
        while j >= 0 and cards[j] > v:
            cards[j+1] = cards[j]
            j -= 1
        cards[j+1] = v
        print(*cards)

n = int(input())
cards = list(map(int, input().split()))
insertion_sort(cards, n)