n = int(raw_input())
A = map(int, raw_input().split(" "))

def printElem(B):
    string = ""
    for elem in B:
        string += str(elem) + " "
    print(string[:len(string)-1])

printElem(A)

for i in range(1, n):
    key = A[i]
    j = i - 1

    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1

    A[j+1] = key

    printElem(A) n = int(raw_input()) n int(raw_input()) int raw_input() raw_input A = map(int, raw_input().split(" ")) A map(int, raw_input().split(" ")) map int raw_input().split(" ") ().split () raw_input split " " def printElem(B):
    string = ""
    for elem in B:
        string += str(elem) + " "
    print(string[:len(string)-1]) printElem string = "" string "" for elem in B:
        string += str(elem) + " "
     elem B string += str(elem) + " " string str(elem) + " " str(elem) str elem " " print(string[:len(string)-1]) print string[:len(string)-1] string :len(string)-1 len(string)-1 len(string) len string 1 B B printElem(A) printElem A for i in range(1, n):
    key = A[i]
    j = i - 1

    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1

    A[j+1] = key

    printElem(A) i range(1, n) range 1 n key = A[i] key A[i] A i j = i - 1 j i - 1 i 1 while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1

     j >= 0 and A[j] > key j >= 0 j 0 A[j] > key A[j] A j key A[j+1] = A[j] A[j+1] A j+1 j 1 A[j] A j j -= 1 j 1 A[j+1] = key A[j+1] A j+1 j 1 key printElem(A) printElem A A = map(int, raw_input().split(" ")) map(int, raw_input().split(" ")) A def printElem(B):
    string = ""
    for elem in B:
        string += str(elem) + " "
    print(string[:len(string)-1]) def printElem(B):
    string = ""
    for elem in B:
        string += str(elem) + " "
    print(string[:len(string)-1]) printElem n = int(raw_input()) int(raw_input()) n j = i - 1 i - 1 j j -= 1 1 j key = A[i] A[i] key
n = int(raw_input())
A = map(int, raw_input().split(" "))

def printElem(B):
    string = ""
    for elem in B:
        string += str(elem) + " "
    print(string[:len(string)-1])

printElem(A)

for i in range(1, n):
    key = A[i]
    j = i - 1

    while j >= 0 and A[j] > key:
        A[j+1] = A[j]
        j -= 1

    A[j+1] = key

    printElem(A)