def insertionSort(_list, _length):
    for i in range(1, _length):
        ll = [str(_l) for _l in _list]
        print(' '.join(ll))
        val = _list[i]
        j = i - 1
        while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
        _list[j+1] = val
    ll = [str(_l) for _l in _list]
    print(' '.join(ll))


length = int(input())
eles = list(map(int, input().split()))

insertionSort(eles, length) def insertionSort(_list, _length):
    for i in range(1, _length):
        ll = [str(_l) for _l in _list]
        print(' '.join(ll))
        val = _list[i]
        j = i - 1
        while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
        _list[j+1] = val
    ll = [str(_l) for _l in _list]
    print(' '.join(ll)) insertionSort for i in range(1, _length):
        ll = [str(_l) for _l in _list]
        print(' '.join(ll))
        val = _list[i]
        j = i - 1
        while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
        _list[j+1] = val
     i range(1, _length) range 1 _length str(_l) for _l in _list for _l in _list _l _list for _l in _list str(_l) str _l ll = [str(_l) for _l in _list] ll [str(_l) for _l in _list] print(' '.join(ll)) print ' '.join(ll) ' '.join ' ' join ll val = _list[i] val _list[i] _list i j = i - 1 j i - 1 i 1 while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
         j >= 0 and _list[j] > val j >= 0 j 0 _list[j] > val _list[j] _list j val _list[j+1] = _list[j] _list[j+1] _list j+1 j 1 _list[j] _list j j -= 1 j 1 _list[j+1] = val _list[j+1] _list j+1 j 1 val str(_l) for _l in _list for _l in _list _l _list for _l in _list str(_l) str _l ll = [str(_l) for _l in _list] ll [str(_l) for _l in _list] print(' '.join(ll)) print ' '.join(ll) ' '.join ' ' join ll _list _list _length _length length = int(input()) length int(input()) int input() input eles = list(map(int, input().split())) eles list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertionSort(eles, length) insertionSort eles length def insertionSort(_list, _length):
    for i in range(1, _length):
        ll = [str(_l) for _l in _list]
        print(' '.join(ll))
        val = _list[i]
        j = i - 1
        while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
        _list[j+1] = val
    ll = [str(_l) for _l in _list]
    print(' '.join(ll)) def insertionSort(_list, _length):
    for i in range(1, _length):
        ll = [str(_l) for _l in _list]
        print(' '.join(ll))
        val = _list[i]
        j = i - 1
        while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
        _list[j+1] = val
    ll = [str(_l) for _l in _list]
    print(' '.join(ll)) insertionSort length = int(input()) int(input()) length eles = list(map(int, input().split())) list(map(int, input().split())) eles
def insertionSort(_list, _length):
    for i in range(1, _length):
        ll = [str(_l) for _l in _list]
        print(' '.join(ll))
        val = _list[i]
        j = i - 1
        while j >= 0 and _list[j] > val:
            _list[j+1] = _list[j]
            j -= 1
        _list[j+1] = val
    ll = [str(_l) for _l in _list]
    print(' '.join(ll))


length = int(input())
eles = list(map(int, input().split()))

insertionSort(eles, length)