

"""simple docstring"""

def 					__UpperCamelCase (     a__:			Union[str, Any]			,						a__:			Union[str, Any]			,						a__:			Tuple      )					->      Union[str, Any]:




					"""simple docstring"""



					if right <= left:
										return
					__lowercase        =      left
					__lowercase        =      right
					__lowercase        =      sorting[left]
					while i <= b:
										if sorting[i] < pivot:
															__lowercase        =      sorting[i], sorting[a]
															a += 1
															i += 1
										elif sorting[i] > pivot:
															__lowercase        =      sorting[i], sorting[b]
															b -= 1
										else:
															i += 1
					quick_sort_apartition(__SCREAMING_SNAKE_CASE			,						__SCREAMING_SNAKE_CASE			,						a - 1      )
					quick_sort_apartition(__SCREAMING_SNAKE_CASE			,						b + 1			,						__SCREAMING_SNAKE_CASE      )





def 					__UpperCamelCase (     a__:			List[Any]			,						a__:			List[Any]			,						a__:			Union[str, Any]      )					->      List[str]:




					"""simple docstring"""



					if left < right:
										__lowercase        =      lomuto_partition(__SCREAMING_SNAKE_CASE			,						__SCREAMING_SNAKE_CASE			,						__SCREAMING_SNAKE_CASE      )
										quick_sort_lomuto_partition(__SCREAMING_SNAKE_CASE			,						__SCREAMING_SNAKE_CASE			,						pivot_index - 1      )
										quick_sort_lomuto_partition(__SCREAMING_SNAKE_CASE			,						pivot_index + 1			,						__SCREAMING_SNAKE_CASE      )





def 					__UpperCamelCase (     a__:			List[str]			,						a__:			List[Any]			,						a__:			Optional[int]      )					->      Any:




					"""simple docstring"""



					__lowercase        =      sorting[right]
					__lowercase        =      left
					for i in range(__SCREAMING_SNAKE_CASE			,						__SCREAMING_SNAKE_CASE      ):
										if sorting[i] < pivot:
															__lowercase        =      sorting[i], sorting[store_index]
															store_index += 1
					__lowercase        =      sorting[store_index], sorting[right]
					return store_index





def 					__UpperCamelCase (     a__:			Optional[int]      )					->      Dict:




					"""simple docstring"""



					if len(__SCREAMING_SNAKE_CASE      ) <= 1:
										return sorting
					return (
					    three_way_radix_quicksort([i for i in sorting if i < sorting[0]]      )
					    + [i for i in sorting if i == sorting[0]]
					    + three_way_radix_quicksort([i for i in sorting if i > sorting[0]]      )
					)


if __name__ == "__main__":
							import doctest

							doctest.testmod(verbose=True)

							a__			:						Optional[Any]							=			input("""Enter numbers separated by a comma:\n""").strip()
							a__			:						Optional[Any]							=			[int(item) for item in user_input.split(""",""")]
							quick_sort_apartition(unsorted, 0, len(unsorted) - 1)
							print(unsorted)




'''simple docstring'''
def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE							):
    """simple docstring"""






    if number != int(__SCREAMING_SNAKE_CASE							):
        raise ValueError("factorial() only accepts integral values"							)
    if number < 0:
        raise ValueError("factorial() not defined for negative values"							)
    snake_case_			:     int        =    1
    for i in range(1,		number + 1							):
        value *= i
    return value

def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE							):
    """simple docstring"""






    if not isinstance(__SCREAMING_SNAKE_CASE,		__SCREAMING_SNAKE_CASE							):
        raise ValueError("factorial() only accepts integral values"							)
    if n < 0:
        raise ValueError("factorial() not defined for negative values"							)
    return 1 if n == 0 or n == 1 else n * factorial(n - 1							)


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  a_           =    int(input("Enter a positive integer: ").strip() or 0)
  print(f"""factorial{n} is {factorial(n)}""")




