"""
implementation of the Insertion Sort
"""
number_of_input = int(raw_input())

numbers = [int(x) for x in raw_input().split()]

for i in range(1, len(numbers)):
    print " ".join([str(x) for x in numbers])
    target = numbers[i]
    index = i - 1
    while index >= 0 and target < numbers[index]:
        numbers[index + 1] = numbers[index]
        index -= 1
    numbers[index + 1] = target

print " ".join([str(x) for x in numbers]) """
implementation of the Insertion Sort
""" number_of_input = int(raw_input()) number_of_input int(raw_input()) int raw_input() raw_input int(x) for x in raw_input().split() for x in raw_input().split() x raw_input().split() ().split () raw_input split for x in raw_input().split() int(x) int x numbers = [int(x) for x in raw_input().split()] numbers [int(x) for x in raw_input().split()] for i in range(1, len(numbers)):
    print " ".join([str(x) for x in numbers])
    target = numbers[i]
    index = i - 1
    while index >= 0 and target < numbers[index]:
        numbers[index + 1] = numbers[index]
        index -= 1
    numbers[index + 1] = target i range(1, len(numbers)) range 1 len(numbers) len numbers print str(x) for x in numbers for x in numbers x numbers for x in numbers str(x) str x " ".join([str(x) for x in numbers]) " ".join " " join [str(x) for x in numbers] target = numbers[i] target numbers[i] numbers i index = i - 1 index i - 1 i 1 while index >= 0 and target < numbers[index]:
        numbers[index + 1] = numbers[index]
        index -= 1
     index >= 0 and target < numbers[index] index >= 0 index 0 target < numbers[index] target numbers[index] numbers index numbers[index + 1] = numbers[index] numbers[index + 1] numbers index + 1 index 1 numbers[index] numbers index index -= 1 index 1 numbers[index + 1] = target numbers[index + 1] numbers index + 1 index 1 target print str(x) for x in numbers for x in numbers x numbers for x in numbers str(x) str x " ".join([str(x) for x in numbers]) " ".join " " join [str(x) for x in numbers] number_of_input = int(raw_input()) int(raw_input()) number_of_input index -= 1 1 index target = numbers[i] numbers[i] target index = i - 1 i - 1 index numbers = [int(x) for x in raw_input().split()] [int(x) for x in raw_input().split()] numbers
"""
implementation of the Insertion Sort
"""
number_of_input = int(raw_input())

numbers = [int(x) for x in raw_input().split()]

for i in range(1, len(numbers)):
    print " ".join([str(x) for x in numbers])
    target = numbers[i]
    index = i - 1
    while index >= 0 and target < numbers[index]:
        numbers[index + 1] = numbers[index]
        index -= 1
    numbers[index + 1] = target

print " ".join([str(x) for x in numbers])