





from __future__ import annotations

def   a_   (			lowerCAmelCase_				:      int,     lowerCAmelCase_				:      Tuple     ):
			# Checks if the entire collection has been sorted
			if len(lowerCAmelCase_     ) <= 1 or n <= 1:
						return

			insert_next(lowerCAmelCase_,     n - 1     )
			rec_insertion_sort(lowerCAmelCase_,     n - 1     )

def   a_   (			lowerCAmelCase_				:      Optional[Any],     lowerCAmelCase_				:      Optional[Any]     ):
			# Checks order between adjacent elements
			if index >= len(lowerCAmelCase_     ) or collection[index - 1] <= collection[index]:
						return

			# Swaps adjacent elements since they are not in ascending order
			__lowerCAmelCase     ,     __lowerCAmelCase							     =     (
			    collection[index],
			    collection[index - 1],
			)

			insert_next(lowerCAmelCase_,     index + 1     )


if __name__ == "__main__":
					_snake_case  :   Optional[int]						   =  input('Enter integers separated by spaces: ')
					_snake_case  :   list[int]						   =  [int(num) for num in numbers.split()]
					rec_insertion_sort(number_list, len(number_list))
					print(number_list)








from functools import lru_cache

@lru_cache
def   a_   (			lowerCAmelCase_				:      int     ):
   if num < 0:
      raise ValueError('Number should not be negative.'     )

   return 1 if num in (0, 1) else num * factorial(num - 1     )


if __name__ == "__main__":
     import doctest

     doctest.testmod()

