n = input()
n = int(n)

numbers = input()
numbers = numbers.split(' ')

for i in range(1, n):
    print(" ".join(numbers))
    j = i - 1
    while (j >= 0) and (int(numbers[j]) > int(numbers[j + 1])):
        numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
        j -= 1
print(" ".join(numbers)) n = input() n input() input n = int(n) n int(n) int n numbers = input() numbers input() input numbers = numbers.split(' ') numbers numbers.split(' ') numbers.split numbers split ' ' for i in range(1, n):
    print(" ".join(numbers))
    j = i - 1
    while (j >= 0) and (int(numbers[j]) > int(numbers[j + 1])):
        numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
        j -= 1 i range(1, n) range 1 n print(" ".join(numbers)) print " ".join(numbers) " ".join " " join numbers j = i - 1 j i - 1 i 1 while (j >= 0) and (int(numbers[j]) > int(numbers[j + 1])):
        numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
        j -= 1 (j >= 0) and (int(numbers[j]) > int(numbers[j + 1])) j >= 0 j 0 int(numbers[j]) > int(numbers[j + 1]) int(numbers[j]) int numbers[j] numbers j int(numbers[j + 1]) int numbers[j + 1] numbers j + 1 j 1 numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j] numbers[j] numbers j numbers[j + 1] numbers j + 1 j 1 numbers[j + 1] numbers j + 1 j 1 numbers[j] numbers j j -= 1 j 1 print(" ".join(numbers)) print " ".join(numbers) " ".join " " join numbers n = int(n) int(n) n j -= 1 1 j n = input() input() n numbers = numbers.split(' ') numbers.split(' ') numbers j = i - 1 i - 1 j numbers = input() input() numbers
n = input()
n = int(n)

numbers = input()
numbers = numbers.split(' ')

for i in range(1, n):
    print(" ".join(numbers))
    j = i - 1
    while (j >= 0) and (int(numbers[j]) > int(numbers[j + 1])):
        numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
        j -= 1
print(" ".join(numbers))