input()
array = [int(x) for x in input().split()]
print(' '.join(list(str(x) for x in array)))
for i in range(1, len(array)):
    key = array[i]
    j = i - 1
    while j >= 0 and array[j] > key:
        array[j + 1] = array[j]
        j -= 1
    array[j + 1] = key
    print(' '.join(list(str(x) for x in array))) input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x array = [int(x) for x in input().split()] array [int(x) for x in input().split()] print(' '.join(list(str(x) for x in array))) print ' '.join(list(str(x) for x in array)) ' '.join ' ' join list(str(x) for x in array) list str(x) str x for i in range(1, len(array)):
    key = array[i]
    j = i - 1
    while j >= 0 and array[j] > key:
        array[j + 1] = array[j]
        j -= 1
    array[j + 1] = key
    print(' '.join(list(str(x) for x in array))) i range(1, len(array)) range 1 len(array) len array key = array[i] key array[i] array i j = i - 1 j i - 1 i 1 while j >= 0 and array[j] > key:
        array[j + 1] = array[j]
        j -= 1
     j >= 0 and array[j] > key j >= 0 j 0 array[j] > key array[j] array j key array[j + 1] = array[j] array[j + 1] array j + 1 j 1 array[j] array j j -= 1 j 1 array[j + 1] = key array[j + 1] array j + 1 j 1 key print(' '.join(list(str(x) for x in array))) print ' '.join(list(str(x) for x in array)) ' '.join ' ' join list(str(x) for x in array) list str(x) str x key = array[i] array[i] key j = i - 1 i - 1 j j -= 1 1 j array = [int(x) for x in input().split()] [int(x) for x in input().split()] array
input()
array = [int(x) for x in input().split()]
print(' '.join(list(str(x) for x in array)))
for i in range(1, len(array)):
    key = array[i]
    j = i - 1
    while j >= 0 and array[j] > key:
        array[j + 1] = array[j]
        j -= 1
    array[j + 1] = key
    print(' '.join(list(str(x) for x in array)))