import sys

ERROR_INPUT = 'input is invalid'


def main():
    n = get_length()
    arr = get_array(length=n)

    insetionSort(li=arr, length=n)
    return 0


def get_length():
    n = int(input())
    if n < 0 or n > 100:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n


def get_array(length):
    nums = input().split(' ')
    return [str2int(string=n) for n in nums]


def str2int(string):
    n = int(string)
    if n < 0 or n > 1000:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n


def insetionSort(li, length):
    for n in range(0, length):
        print(*(sorted(li[0:n + 1]) + li[n + 1:length]))


main() import sys sys ERROR_INPUT = 'input is invalid' ERROR_INPUT 'input is invalid' def main():
    n = get_length()
    arr = get_array(length=n)

    insetionSort(li=arr, length=n)
    return 0 main n = get_length() n get_length() get_length arr = get_array(length=n) arr get_array(length=n) get_array length=n length n insetionSort(li=arr, length=n) insetionSort li=arr li arr length=n length n return 0 0 def get_length():
    n = int(input())
    if n < 0 or n > 100:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n get_length n = int(input()) n int(input()) int input() input if n < 0 or n > 100:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n n < 0 or n > 100 n < 0 n 0 n > 100 n 100 print(ERROR_INPUT) print ERROR_INPUT sys.exit(1) sys.exit sys exit 1 return n n def get_array(length):
    nums = input().split(' ')
    return [str2int(string=n) for n in nums] get_array nums = input().split(' ') nums input().split(' ') ().split () input split ' ' str2int(string=n) for n in nums for n in nums n nums for n in nums str2int(string=n) str2int string=n string n return [str2int(string=n) for n in nums] [str2int(string=n) for n in nums] length length def str2int(string):
    n = int(string)
    if n < 0 or n > 1000:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n str2int n = int(string) n int(string) int string if n < 0 or n > 1000:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n n < 0 or n > 1000 n < 0 n 0 n > 1000 n 1000 print(ERROR_INPUT) print ERROR_INPUT sys.exit(1) sys.exit sys exit 1 return n n string string def insetionSort(li, length):
    for n in range(0, length):
        print(*(sorted(li[0:n + 1]) + li[n + 1:length])) insetionSort for n in range(0, length):
        print(*(sorted(li[0:n + 1]) + li[n + 1:length])) n range(0, length) range 0 length print(*(sorted(li[0:n + 1]) + li[n + 1:length])) print *(sorted(li[0:n + 1]) + li[n + 1:length]) sorted(li[0:n + 1]) + li[n + 1:length] sorted(li[0:n + 1]) sorted li[0:n + 1] li 0:n + 1 0 n + 1 n 1 li[n + 1:length] li n + 1:length n + 1 n 1 length li li length length main() main def str2int(string):
    n = int(string)
    if n < 0 or n > 1000:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n def str2int(string):
    n = int(string)
    if n < 0 or n > 1000:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n str2int def main():
    n = get_length()
    arr = get_array(length=n)

    insetionSort(li=arr, length=n)
    return 0 def main():
    n = get_length()
    arr = get_array(length=n)

    insetionSort(li=arr, length=n)
    return 0 main def get_length():
    n = int(input())
    if n < 0 or n > 100:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n def get_length():
    n = int(input())
    if n < 0 or n > 100:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n get_length def insetionSort(li, length):
    for n in range(0, length):
        print(*(sorted(li[0:n + 1]) + li[n + 1:length])) def insetionSort(li, length):
    for n in range(0, length):
        print(*(sorted(li[0:n + 1]) + li[n + 1:length])) insetionSort def get_array(length):
    nums = input().split(' ')
    return [str2int(string=n) for n in nums] def get_array(length):
    nums = input().split(' ')
    return [str2int(string=n) for n in nums] get_array ERROR_INPUT = 'input is invalid' 'input is invalid' ERROR_INPUT
import sys

ERROR_INPUT = 'input is invalid'


def main():
    n = get_length()
    arr = get_array(length=n)

    insetionSort(li=arr, length=n)
    return 0


def get_length():
    n = int(input())
    if n < 0 or n > 100:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n


def get_array(length):
    nums = input().split(' ')
    return [str2int(string=n) for n in nums]


def str2int(string):
    n = int(string)
    if n < 0 or n > 1000:
        print(ERROR_INPUT)
        sys.exit(1)
    else:
        return n


def insetionSort(li, length):
    for n in range(0, length):
        print(*(sorted(li[0:n + 1]) + li[n + 1:length]))


main()