import sys

def insert_sort(array):
    for i in range(0, len(array)):
        v = array[i]
        j = i - 1
        while (j >= 0) and (array[j] > v):
            array[j + 1] = array[j]
            j -= 1
        array[j + 1] = v
        print print_list(array)
    return array

def print_list(array):
    s = ""
    for n in array:
        s += str(n) + " "
    s = s.strip()
    return s
    
if __name__ == "__main__":
    array_num = int(sys.stdin.readline().strip())
    array = map(lambda x: int(x), list(sys.stdin.readline().strip().split(" ")))
    array = insert_sort(array) import sys sys def insert_sort(array):
    for i in range(0, len(array)):
        v = array[i]
        j = i - 1
        while (j >= 0) and (array[j] > v):
            array[j + 1] = array[j]
            j -= 1
        array[j + 1] = v
        print print_list(array)
    return array insert_sort for i in range(0, len(array)):
        v = array[i]
        j = i - 1
        while (j >= 0) and (array[j] > v):
            array[j + 1] = array[j]
            j -= 1
        array[j + 1] = v
        print print_list(array)
     i range(0, len(array)) range 0 len(array) len array v = array[i] v array[i] array i j = i - 1 j i - 1 i 1 while (j >= 0) and (array[j] > v):
            array[j + 1] = array[j]
            j -= 1
         (j >= 0) and (array[j] > v) j >= 0 j 0 array[j] > v array[j] array j v array[j + 1] = array[j] array[j + 1] array j + 1 j 1 array[j] array j j -= 1 j 1 array[j + 1] = v array[j + 1] array j + 1 j 1 v print print_list(array) print_list array return array array array array def print_list(array):
    s = ""
    for n in array:
        s += str(n) + " "
    s = s.strip()
    return s
     print_list s = "" s "" for n in array:
        s += str(n) + " "
     n array s += str(n) + " " s str(n) + " " str(n) str n " " s = s.strip() s s.strip() s.strip s strip return s s array array if __name__ == "__main__":
    array_num = int(sys.stdin.readline().strip())
    array = map(lambda x: int(x), list(sys.stdin.readline().strip().split(" ")))
    array = insert_sort(array) __name__ == "__main__" __name__ "__main__" array_num = int(sys.stdin.readline().strip()) array_num int(sys.stdin.readline().strip()) int sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip array = map(lambda x: int(x), list(sys.stdin.readline().strip().split(" "))) array map(lambda x: int(x), list(sys.stdin.readline().strip().split(" "))) map lambda x: int(x) int(x) int x x list(sys.stdin.readline().strip().split(" ")) list sys.stdin.readline().strip().split(" ") sys.stdin.readline().strip().split sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip split " " array = insert_sort(array) array insert_sort(array) insert_sort array def insert_sort(array):
    for i in range(0, len(array)):
        v = array[i]
        j = i - 1
        while (j >= 0) and (array[j] > v):
            array[j + 1] = array[j]
            j -= 1
        array[j + 1] = v
        print print_list(array)
    return array def insert_sort(array):
    for i in range(0, len(array)):
        v = array[i]
        j = i - 1
        while (j >= 0) and (array[j] > v):
            array[j + 1] = array[j]
            j -= 1
        array[j + 1] = v
        print print_list(array)
    return array insert_sort array = map(lambda x: int(x), list(sys.stdin.readline().strip().split(" "))) map(lambda x: int(x), list(sys.stdin.readline().strip().split(" "))) array array = insert_sort(array) insert_sort(array) array array_num = int(sys.stdin.readline().strip()) int(sys.stdin.readline().strip()) array_num def print_list(array):
    s = ""
    for n in array:
        s += str(n) + " "
    s = s.strip()
    return s
     def print_list(array):
    s = ""
    for n in array:
        s += str(n) + " "
    s = s.strip()
    return s
     print_list
import sys

def insert_sort(array):
    for i in range(0, len(array)):
        v = array[i]
        j = i - 1
        while (j >= 0) and (array[j] > v):
            array[j + 1] = array[j]
            j -= 1
        array[j + 1] = v
        print print_list(array)
    return array

def print_list(array):
    s = ""
    for n in array:
        s += str(n) + " "
    s = s.strip()
    return s
    
if __name__ == "__main__":
    array_num = int(sys.stdin.readline().strip())
    array = map(lambda x: int(x), list(sys.stdin.readline().strip().split(" ")))
    array = insert_sort(array)