def gnome_sort(lst: list) -> list:
if len(lst) <= 1:
return lst
i = 1
while i < len(lst):
if lst[i - 1] <= lst[i]:
i += 1
else:
lst[i - 1], lst[i] = lst[i], lst[i - 1]
i -= 1
if i == 0:
i = 1
return lst
if __name__ == "__main__":
user_input = input("Enter numbers separated by a comma:n").strip()
unsorted = [int(item) for item in user_input.split(",")]
print(gnome_sort(unsorted))



