def isSorted(a): return all([a[i] <= a[i + 1] for i in range(len(a) - 1)]) arr = input("") list = [int(n) for n in arr.split()] if(isSorted(list)): print("The list is already sorted") else: print("The list is not sorted")