newNo = ar[-1]
for i in range(0, m - 1):
    if newNo < ar[m - i - 1]:
        ar[m - i] = ar[m - i - 1]
for e in ar:
    print(e, end=' ')
print() 
ar[m - i - 1] = newNo
for f in ar:
    print(f, end=' ')
m = eval(input())
ar = [int(i) for i in input().strip().split()]
insertionSort(ar)
Печатать элементы списка на новой строке