def insertion_sort(seq):
    print(' '.join(map(str, seq)))
    for i in range(1, len(seq)):
        key = seq[i]
        j = i - 1
        while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
        seq[j+1] = key
        print(' '.join(map(str, seq)))
    return seq

n = int(input())
seq = list(map(int, input().split()))
insertion_sort(seq) def insertion_sort(seq):
    print(' '.join(map(str, seq)))
    for i in range(1, len(seq)):
        key = seq[i]
        j = i - 1
        while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
        seq[j+1] = key
        print(' '.join(map(str, seq)))
    return seq insertion_sort print(' '.join(map(str, seq))) print ' '.join(map(str, seq)) ' '.join ' ' join map(str, seq) map str seq for i in range(1, len(seq)):
        key = seq[i]
        j = i - 1
        while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
        seq[j+1] = key
        print(' '.join(map(str, seq)))
     i range(1, len(seq)) range 1 len(seq) len seq key = seq[i] key seq[i] seq i j = i - 1 j i - 1 i 1 while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
         j >= 0 and seq[j] > key j >= 0 j 0 seq[j] > key seq[j] seq j key seq[j+1] = seq[j] seq[j+1] seq j+1 j 1 seq[j] seq j j -= 1 j 1 seq[j+1] = key seq[j+1] seq j+1 j 1 key print(' '.join(map(str, seq))) print ' '.join(map(str, seq)) ' '.join ' ' join map(str, seq) map str seq return seq seq seq seq n = int(input()) n int(input()) int input() input seq = list(map(int, input().split())) seq list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split insertion_sort(seq) insertion_sort seq n = int(input()) int(input()) n def insertion_sort(seq):
    print(' '.join(map(str, seq)))
    for i in range(1, len(seq)):
        key = seq[i]
        j = i - 1
        while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
        seq[j+1] = key
        print(' '.join(map(str, seq)))
    return seq def insertion_sort(seq):
    print(' '.join(map(str, seq)))
    for i in range(1, len(seq)):
        key = seq[i]
        j = i - 1
        while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
        seq[j+1] = key
        print(' '.join(map(str, seq)))
    return seq insertion_sort seq = list(map(int, input().split())) list(map(int, input().split())) seq
def insertion_sort(seq):
    print(' '.join(map(str, seq)))
    for i in range(1, len(seq)):
        key = seq[i]
        j = i - 1
        while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
        seq[j+1] = key
        print(' '.join(map(str, seq)))
    return seq

n = int(input())
seq = list(map(int, input().split()))
insertion_sort(seq)