


"""simple docstring"""






def __lowercase  (   lowerCamelCase_	:   List[Any]    ,       lowerCamelCase_	:   Tuple    ,       lowerCamelCase_	:   List[str]	):
				assert b != 0, "This cannot accept modulo that is == 0"
				if n == 0:
								return 1

				if n % 2 == 1:
								return (bin_exp_mod(lowerCamelCase_    ,       n - 1    ,       lowerCamelCase_	) * a) % b

				SCREAMING_SNAKE_CASE__  				=					bin_exp_mod(lowerCamelCase_    ,       n / 2    ,       lowerCamelCase_	)
				return (r * r) % b


if __name__ == "__main__":
	try:
		_lowerCamelCase  =	int(input('Enter Base : ').strip())
		_lowerCamelCase  =	int(input('Enter Power : ').strip())
		_lowerCamelCase  =	int(input('Enter Modulo : ').strip())
	except ValueError:
		print('Invalid literal for integer')

	print(bin_exp_mod(BASE, POWER, MODULO))




"""simple docstring"""






def __lowercase  (   lowerCamelCase_	:   list	):
				if not isinstance(lowerCamelCase_    ,       lowerCamelCase_	):
								raise ValueError("Input series is not valid, valid series - [2, 4, 8]"	)
				if len(lowerCamelCase_	) == 0:
								raise ValueError("Input list must be a non empty list"	)
				if len(lowerCamelCase_	) == 1:
								return True
				try:
								SCREAMING_SNAKE_CASE__  				=					series[1] / series[0]
								for index in range(len(lowerCamelCase_	) - 1	):
												if series[index + 1] / series[index] != common_ratio:
																return False
				except ZeroDivisionError:
								return False
				return True


def __lowercase  (   lowerCamelCase_	:   list	):
				if not isinstance(lowerCamelCase_    ,       lowerCamelCase_	):
								raise ValueError("Input series is not valid, valid series - [2, 4, 8]"	)
				if len(lowerCamelCase_	) == 0:
								raise ValueError("Input list must be a non empty list"	)
				SCREAMING_SNAKE_CASE__  				=					1
				for value in series:
								answer *= value
				return pow(lowerCamelCase_    ,       1 / len(lowerCamelCase_	)	)


if __name__ == "__main__":
	import doctest

	doctest.testmod()
