# coding:utf-8

def printline(data):
    l=""
    for i,s in enumerate(data):
        l = l + str(s)
        if i+1 != len(data):
            l = l+" "
    print(l)


length = int(input())
data = list(map(int,input().split()))
printline(data)
for i in range(1,len(data)):
    tmp = data[i]
    i2 = i - 1
    while i2 >=0 and data[i2] > tmp:
        data[i2+1] = data[i2]
        i2 -= 1

    data[i2+1] = tmp
    printline(data) def printline(data):
    l=""
    for i,s in enumerate(data):
        l = l + str(s)
        if i+1 != len(data):
            l = l+" "
    print(l) printline l="" l "" for i,s in enumerate(data):
        l = l + str(s)
        if i+1 != len(data):
            l = l+" "
     i s enumerate(data) enumerate data l = l + str(s) l l + str(s) l str(s) str s if i+1 != len(data):
            l = l+" "
     i+1 != len(data) i+1 i 1 len(data) len data l = l+" " l l+" " l " " print(l) print l data data length = int(input()) length int(input()) int input() input data = list(map(int,input().split())) data list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split printline(data) printline data for i in range(1,len(data)):
    tmp = data[i]
    i2 = i - 1
    while i2 >=0 and data[i2] > tmp:
        data[i2+1] = data[i2]
        i2 -= 1

    data[i2+1] = tmp
    printline(data) i range(1,len(data)) range 1 len(data) len data tmp = data[i] tmp data[i] data i i2 = i - 1 i2 i - 1 i 1 while i2 >=0 and data[i2] > tmp:
        data[i2+1] = data[i2]
        i2 -= 1

     i2 >=0 and data[i2] > tmp i2 >=0 i2 0 data[i2] > tmp data[i2] data i2 tmp data[i2+1] = data[i2] data[i2+1] data i2+1 i2 1 data[i2] data i2 i2 -= 1 i2 1 data[i2+1] = tmp data[i2+1] data i2+1 i2 1 tmp printline(data) printline data data = list(map(int,input().split())) list(map(int,input().split())) data i2 -= 1 1 i2 length = int(input()) int(input()) length def printline(data):
    l=""
    for i,s in enumerate(data):
        l = l + str(s)
        if i+1 != len(data):
            l = l+" "
    print(l) def printline(data):
    l=""
    for i,s in enumerate(data):
        l = l + str(s)
        if i+1 != len(data):
            l = l+" "
    print(l) printline i2 = i - 1 i - 1 i2 tmp = data[i] data[i] tmp
# coding:utf-8

def printline(data):
    l=""
    for i,s in enumerate(data):
        l = l + str(s)
        if i+1 != len(data):
            l = l+" "
    print(l)


length = int(input())
data = list(map(int,input().split()))
printline(data)
for i in range(1,len(data)):
    tmp = data[i]
    i2 = i - 1
    while i2 >=0 and data[i2] > tmp:
        data[i2+1] = data[i2]
        i2 -= 1

    data[i2+1] = tmp
    printline(data)
