n = int(input())
sequence = input().split(' ')
sequence = [int(x) for x in sequence]
for h in range(n - 1):
    print(format(sequence[h]) + ' ', end='')
print(sequence[n - 1])

for i in range(1, n):
    v = sequence[i]
    j = i - 1
    while j >= 0 and sequence[j] > v:
        sequence[j+1] = sequence[j]
        j -= 1
    sequence[j+1] = v
    for k in range(n-1):
        print(format(sequence[k]) + ' ', end='')
    print(sequence[n-1]) n = int(input()) n int(input()) int input() input sequence = input().split(' ') sequence input().split(' ') ().split () input split ' ' int(x) for x in sequence for x in sequence x sequence for x in sequence int(x) int x sequence = [int(x) for x in sequence] sequence [int(x) for x in sequence] for h in range(n - 1):
    print(format(sequence[h]) + ' ', end='') h range(n - 1) range n - 1 n 1 print(format(sequence[h]) + ' ', end='') print format(sequence[h]) + ' ' format(sequence[h]) format sequence[h] sequence h ' ' end='' end '' print(sequence[n - 1]) print sequence[n - 1] sequence n - 1 n 1 for i in range(1, n):
    v = sequence[i]
    j = i - 1
    while j >= 0 and sequence[j] > v:
        sequence[j+1] = sequence[j]
        j -= 1
    sequence[j+1] = v
    for k in range(n-1):
        print(format(sequence[k]) + ' ', end='')
    print(sequence[n-1]) i range(1, n) range 1 n v = sequence[i] v sequence[i] sequence i j = i - 1 j i - 1 i 1 while j >= 0 and sequence[j] > v:
        sequence[j+1] = sequence[j]
        j -= 1
     j >= 0 and sequence[j] > v j >= 0 j 0 sequence[j] > v sequence[j] sequence j v sequence[j+1] = sequence[j] sequence[j+1] sequence j+1 j 1 sequence[j] sequence j j -= 1 j 1 sequence[j+1] = v sequence[j+1] sequence j+1 j 1 v for k in range(n-1):
        print(format(sequence[k]) + ' ', end='')
     k range(n-1) range n-1 n 1 print(format(sequence[k]) + ' ', end='') print format(sequence[k]) + ' ' format(sequence[k]) format sequence[k] sequence k ' ' end='' end '' print(sequence[n-1]) print sequence[n-1] sequence n-1 n 1 sequence = [int(x) for x in sequence] [int(x) for x in sequence] sequence sequence = input().split(' ') input().split(' ') sequence v = sequence[i] sequence[i] v j -= 1 1 j n = int(input()) int(input()) n j = i - 1 i - 1 j
n = int(input())
sequence = input().split(' ')
sequence = [int(x) for x in sequence]
for h in range(n - 1):
    print(format(sequence[h]) + ' ', end='')
print(sequence[n - 1])

for i in range(1, n):
    v = sequence[i]
    j = i - 1
    while j >= 0 and sequence[j] > v:
        sequence[j+1] = sequence[j]
        j -= 1
    sequence[j+1] = v
    for k in range(n-1):
        print(format(sequence[k]) + ' ', end='')
    print(sequence[n-1])