def insertion_sort(array):
    for i in range(len(array)):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        print(' '.join(map(str, array)))

    return array

if __name__ == '__main__':
    element_number = int(input())
    input_array = list(map(int, input().split()))

    insertion_sort(input_array) def insertion_sort(array):
    for i in range(len(array)):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        print(' '.join(map(str, array)))

    return array insertion_sort for i in range(len(array)):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        print(' '.join(map(str, array)))

     i range(len(array)) range 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 = 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 = j - 1 j j - 1 j 1 array[j+1] = v array[j+1] array j+1 j 1 v print(' '.join(map(str, array))) print ' '.join(map(str, array)) ' '.join ' ' join map(str, array) map str array return array array array array if __name__ == '__main__':
    element_number = int(input())
    input_array = list(map(int, input().split()))

    insertion_sort(input_array) __name__ == '__main__' __name__ '__main__' element_number = int(input()) element_number int(input()) int input() input input_array = list(map(int, input().split())) input_array list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertion_sort(input_array) insertion_sort input_array input_array = list(map(int, input().split())) list(map(int, input().split())) input_array element_number = int(input()) int(input()) element_number def insertion_sort(array):
    for i in range(len(array)):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        print(' '.join(map(str, array)))

    return array def insertion_sort(array):
    for i in range(len(array)):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        print(' '.join(map(str, array)))

    return array insertion_sort
def insertion_sort(array):
    for i in range(len(array)):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        print(' '.join(map(str, array)))

    return array

if __name__ == '__main__':
    element_number = int(input())
    input_array = list(map(int, input().split()))

    insertion_sort(input_array)