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