import sys

n = input()
sort_list = list()

sort_list = map(int, raw_input().split())

for i in range(0,n):
    
    
    tmp = sort_list[i]
    j = i - 1
    while j >= 0 and sort_list[j] > tmp:
        sort_list[j+1] = sort_list[j]
        j = j - 1

    sort_list[j+1] = tmp


    for k in range(0,n):
        sys.stdout.write(str(sort_list[k]))
        if k is not n - 1:
            sys.stdout.write(" ")
        elif i is not n - 1:
            sys.stdout.write("\n")
            
print("")
 import sys sys n = input() n input() input sort_list = list() sort_list list() list sort_list = map(int, raw_input().split()) sort_list map(int, raw_input().split()) map int raw_input().split() ().split () raw_input split for i in range(0,n):
    
    
    tmp = sort_list[i]
    j = i - 1
    while j >= 0 and sort_list[j] > tmp:
        sort_list[j+1] = sort_list[j]
        j = j - 1

    sort_list[j+1] = tmp


    for k in range(0,n):
        sys.stdout.write(str(sort_list[k]))
        if k is not n - 1:
            sys.stdout.write(" ")
        elif i is not n - 1:
            sys.stdout.write("\n")
             i range(0,n) range 0 n tmp = sort_list[i] tmp sort_list[i] sort_list i j = i - 1 j i - 1 i 1 while j >= 0 and sort_list[j] > tmp:
        sort_list[j+1] = sort_list[j]
        j = j - 1

     j >= 0 and sort_list[j] > tmp j >= 0 j 0 sort_list[j] > tmp sort_list[j] sort_list j tmp sort_list[j+1] = sort_list[j] sort_list[j+1] sort_list j+1 j 1 sort_list[j] sort_list j j = j - 1 j j - 1 j 1 sort_list[j+1] = tmp sort_list[j+1] sort_list j+1 j 1 tmp for k in range(0,n):
        sys.stdout.write(str(sort_list[k]))
        if k is not n - 1:
            sys.stdout.write(" ")
        elif i is not n - 1:
            sys.stdout.write("\n")
             k range(0,n) range 0 n sys.stdout.write(str(sort_list[k])) sys.stdout.write sys.stdout sys stdout write str(sort_list[k]) str sort_list[k] sort_list k if k is not n - 1:
            sys.stdout.write(" ")
        elif i is not n - 1:
            sys.stdout.write("\n")
             k is not n - 1 k n - 1 n 1 sys.stdout.write(" ") sys.stdout.write sys.stdout sys stdout write " " elif i is not n - 1:
            sys.stdout.write("\n")
             i is not n - 1 i n - 1 n 1 sys.stdout.write("\n") sys.stdout.write sys.stdout sys stdout write "\n" print("") print "" sort_list = map(int, raw_input().split()) map(int, raw_input().split()) sort_list tmp = sort_list[i] sort_list[i] tmp j = i - 1 i - 1 j n = input() input() n sort_list = list() list() sort_list j = j - 1 j - 1 j
import sys

n = input()
sort_list = list()

sort_list = map(int, raw_input().split())

for i in range(0,n):
    
    
    tmp = sort_list[i]
    j = i - 1
    while j >= 0 and sort_list[j] > tmp:
        sort_list[j+1] = sort_list[j]
        j = j - 1

    sort_list[j+1] = tmp


    for k in range(0,n):
        sys.stdout.write(str(sort_list[k]))
        if k is not n - 1:
            sys.stdout.write(" ")
        elif i is not n - 1:
            sys.stdout.write("\n")
            
print("")

