""" created by Sarvesh kumar sharma """

'''implementation of the Insertion sort algorithm in Python'''


def insertion_sort(list2):
    n = len(list2)
    for i in range(1, n):
        save = list2[i]
        j = i
        while j > 0 and list2[j - 1] > save:
            list2[j] = list2[j - 1]
            j -= 1
        list2[j] = save
    return list2


if __name__ == "__main__":
    user_input = input("Enter numbers separated by a comma:\n").strip()
    unsorted = [int(item) for item in user_input.split(",")]
    print(insertion_sort(unsorted))
