def insert(array, index):
    value = array[index]
    for i in range(index - 1, -1, -1):
        if array[i] < value:
            array[i+1] = value
            break
        array[i + 1] = array[i]
    else:
        array[0] = value

def insertion_sort(array, log=False):
    for i in range(len(array)):
        insert(array, i)
        if log:
            print(*array)

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    insertion_sort(A, True) def insert(array, index):
    value = array[index]
    for i in range(index - 1, -1, -1):
        if array[i] < value:
            array[i+1] = value
            break
        array[i + 1] = array[i]
    else:
        array[0] = value insert value = array[index] value array[index] array index for i in range(index - 1, -1, -1):
        if array[i] < value:
            array[i+1] = value
            break
        array[i + 1] = array[i]
    else:
        array[0] = value i range(index - 1, -1, -1) range index - 1 index 1 -1 -1 if array[i] < value:
            array[i+1] = value
            break
         array[i] < value array[i] array i value array[i+1] = value array[i+1] array i+1 i 1 value break array[i + 1] = array[i] array[i + 1] array i + 1 i 1 array[i] array i array[0] = value array[0] array 0 value array array index index def insertion_sort(array, log=False):
    for i in range(len(array)):
        insert(array, i)
        if log:
            print(*array) insertion_sort for i in range(len(array)):
        insert(array, i)
        if log:
            print(*array) i range(len(array)) range len(array) len array insert(array, i) insert array i if log:
            print(*array) log print(*array) print *array array array array log=False log False if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    insertion_sort(A, True) __name__ == "__main__" __name__ "__main__" N = int(input()) N int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertion_sort(A, True) insertion_sort A True N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A def insert(array, index):
    value = array[index]
    for i in range(index - 1, -1, -1):
        if array[i] < value:
            array[i+1] = value
            break
        array[i + 1] = array[i]
    else:
        array[0] = value def insert(array, index):
    value = array[index]
    for i in range(index - 1, -1, -1):
        if array[i] < value:
            array[i+1] = value
            break
        array[i + 1] = array[i]
    else:
        array[0] = value insert def insertion_sort(array, log=False):
    for i in range(len(array)):
        insert(array, i)
        if log:
            print(*array) def insertion_sort(array, log=False):
    for i in range(len(array)):
        insert(array, i)
        if log:
            print(*array) insertion_sort
def insert(array, index):
    value = array[index]
    for i in range(index - 1, -1, -1):
        if array[i] < value:
            array[i+1] = value
            break
        array[i + 1] = array[i]
    else:
        array[0] = value

def insertion_sort(array, log=False):
    for i in range(len(array)):
        insert(array, i)
        if log:
            print(*array)

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    insertion_sort(A, True)