



__A				    =						{hex(i)[2:]: i for i in range(16)}  # Use [:2] to strip off the leading '0x'



def        __a     (    lowerCAmelCase_   :					str				)      -> int:






						'''simple docstring'''



						UpperCAmelCase_=   hex_string.strip().lower()
						if not hex_string:
												raise ValueError("""Empty string was passed to the function"""				)
						UpperCAmelCase_=   hex_string[0] == """-"""
						if is_negative:
												UpperCAmelCase_=   hex_string[1:]
						if not all(char in hex_table for char in hex_string				):
												raise ValueError("""Non-hexadecimal value was passed to the function"""				)
						UpperCAmelCase_=   0
						for char in hex_string:
												UpperCAmelCase_=   16 * decimal_number + hex_table[char]
						return -decimal_number if is_negative else decimal_number


if __name__ == "__main__":
	from doctest import testmod

	testmod()









def        __a     (    lowerCAmelCase_   :					int				)      -> int:






						'''simple docstring'''



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



def        __a     (    lowerCAmelCase_   :					int				)      -> int:






						'''simple docstring'''



						if not isinstance(lowerCAmelCase_			,lowerCAmelCase_				):
												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)}')




