def out(data) -> str:
    print(' '.join(map(str, data)))


N = int(input())
data = [int(i) for i in input().split()]
out(data)
for i in range(1, N):
    tmp = data[i]
    j = i - 1
    while j >= 0 and data[j] > tmp:
        data[j + 1] = data[j]
        j -= 1
    data[j + 1] = tmp
    out(data) def out(data) -> str:
    print(' '.join(map(str, data))) out print(' '.join(map(str, data))) print ' '.join(map(str, data)) ' '.join ' ' join map(str, data) map str data data data N = int(input()) N int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i data = [int(i) for i in input().split()] data [int(i) for i in input().split()] out(data) out data for i in range(1, N):
    tmp = data[i]
    j = i - 1
    while j >= 0 and data[j] > tmp:
        data[j + 1] = data[j]
        j -= 1
    data[j + 1] = tmp
    out(data) i range(1, N) range 1 N tmp = data[i] tmp data[i] data i j = i - 1 j i - 1 i 1 while j >= 0 and data[j] > tmp:
        data[j + 1] = data[j]
        j -= 1
     j >= 0 and data[j] > tmp j >= 0 j 0 data[j] > tmp data[j] data j tmp data[j + 1] = data[j] data[j + 1] data j + 1 j 1 data[j] data j j -= 1 j 1 data[j + 1] = tmp data[j + 1] data j + 1 j 1 tmp out(data) out data j -= 1 1 j j = i - 1 i - 1 j tmp = data[i] data[i] tmp data = [int(i) for i in input().split()] [int(i) for i in input().split()] data def out(data) -> str:
    print(' '.join(map(str, data))) def out(data) -> str:
    print(' '.join(map(str, data))) out N = int(input()) int(input()) N
def out(data) -> str:
    print(' '.join(map(str, data)))


N = int(input())
data = [int(i) for i in input().split()]
out(data)
for i in range(1, N):
    tmp = data[i]
    j = i - 1
    while j >= 0 and data[j] > tmp:
        data[j + 1] = data[j]
        j -= 1
    data[j + 1] = tmp
    out(data)
