# ?????\?????????????????°??????
import sys

def print_data(data):
    last_index = len(data) - 1
    
    for idx, item in enumerate(data):
        print(item, end='')
        if idx != last_index:
            print(' ', end='')

    print('')
        
def main():
    n = int(sys.stdin.readline().strip())
    data = [int(i) for i in sys.stdin.readline().strip().split(' ')]
    print_data(data)
    
    for i in range(1, n):
        v = data[i]
        j = i - 1

        while j >= 0 and data[j] > v:
            data[j+1] = data[j]
            j -= 1

        data[j+1] = v
        print_data(data)
            
if __name__ == '__main__':
    main() import sys sys def print_data(data):
    last_index = len(data) - 1
    
    for idx, item in enumerate(data):
        print(item, end='')
        if idx != last_index:
            print(' ', end='')

    print('')
         print_data last_index = len(data) - 1 last_index len(data) - 1 len(data) len data 1 for idx, item in enumerate(data):
        print(item, end='')
        if idx != last_index:
            print(' ', end='')

     idx item enumerate(data) enumerate data print(item, end='') print item end='' end '' if idx != last_index:
            print(' ', end='')

     idx != last_index idx last_index print(' ', end='') print ' ' end='' end '' print('') print '' data data def main():
    n = int(sys.stdin.readline().strip())
    data = [int(i) for i in sys.stdin.readline().strip().split(' ')]
    print_data(data)
    
    for i in range(1, n):
        v = data[i]
        j = i - 1

        while j >= 0 and data[j] > v:
            data[j+1] = data[j]
            j -= 1

        data[j+1] = v
        print_data(data)
             main n = int(sys.stdin.readline().strip()) n 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 int(i) for i in sys.stdin.readline().strip().split(' ') for i in sys.stdin.readline().strip().split(' ') i 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 ' ' for i in sys.stdin.readline().strip().split(' ') int(i) int i data = [int(i) for i in sys.stdin.readline().strip().split(' ')] data [int(i) for i in sys.stdin.readline().strip().split(' ')] print_data(data) print_data data for i in range(1, n):
        v = data[i]
        j = i - 1

        while j >= 0 and data[j] > v:
            data[j+1] = data[j]
            j -= 1

        data[j+1] = v
        print_data(data)
             i range(1, n) range 1 n v = data[i] v data[i] data i j = i - 1 j i - 1 i 1 while j >= 0 and data[j] > v:
            data[j+1] = data[j]
            j -= 1

         j >= 0 and data[j] > v j >= 0 j 0 data[j] > v data[j] data j v data[j+1] = data[j] data[j+1] data j+1 j 1 data[j] data j j -= 1 j 1 data[j+1] = v data[j+1] data j+1 j 1 v print_data(data) print_data data if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def print_data(data):
    last_index = len(data) - 1
    
    for idx, item in enumerate(data):
        print(item, end='')
        if idx != last_index:
            print(' ', end='')

    print('')
         def print_data(data):
    last_index = len(data) - 1
    
    for idx, item in enumerate(data):
        print(item, end='')
        if idx != last_index:
            print(' ', end='')

    print('')
         print_data def main():
    n = int(sys.stdin.readline().strip())
    data = [int(i) for i in sys.stdin.readline().strip().split(' ')]
    print_data(data)
    
    for i in range(1, n):
        v = data[i]
        j = i - 1

        while j >= 0 and data[j] > v:
            data[j+1] = data[j]
            j -= 1

        data[j+1] = v
        print_data(data)
             def main():
    n = int(sys.stdin.readline().strip())
    data = [int(i) for i in sys.stdin.readline().strip().split(' ')]
    print_data(data)
    
    for i in range(1, n):
        v = data[i]
        j = i - 1

        while j >= 0 and data[j] > v:
            data[j+1] = data[j]
            j -= 1

        data[j+1] = v
        print_data(data)
             main
# ?????\?????????????????°??????
import sys

def print_data(data):
    last_index = len(data) - 1
    
    for idx, item in enumerate(data):
        print(item, end='')
        if idx != last_index:
            print(' ', end='')

    print('')
        
def main():
    n = int(sys.stdin.readline().strip())
    data = [int(i) for i in sys.stdin.readline().strip().split(' ')]
    print_data(data)
    
    for i in range(1, n):
        v = data[i]
        j = i - 1

        while j >= 0 and data[j] > v:
            data[j+1] = data[j]
            j -= 1

        data[j+1] = v
        print_data(data)
            
if __name__ == '__main__':
    main()