

from string import ascii_uppercase

__snake_case				:      int   		=			{str(ord(c) - 55): c for c in ascii_uppercase}


def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			if isinstance(a__  ,	a__):
						raise TypeError("""int() can't convert non-string with explicit base""")
			if num < 0:
						raise ValueError("""parameter must be positive int""")
			if isinstance(a__  ,	a__):
						raise TypeError("""'str' object cannot be interpreted as an integer""")
			if isinstance(a__  ,	a__):
						raise TypeError("""'float' object cannot be interpreted as an integer""")
			if base in (0, 1):
						raise ValueError("""base must be >= 2""")
			if base > 3_6:
						raise ValueError("""base must be <= 36""")
			a_						:						str 							= """"""
			a_						:						Tuple 							= 0
			a_						:						Optional[Any] 							= 0
			while div != 1:
						a_							,					a_						:						Union[str, Any] 							= divmod(a__  ,	a__)
						if base >= 1_1 and 9 < mod < 3_6:
									a_						:						str 							= ALPHABET_VALUES[str(a__)]
						else:
									a_						:						str 							= str(a__)
						new_value += actual_value
						a_						:						Dict 							= num // base
						a_						:						Union[str, Any] 							= div
						if div == 0:
									return str(new_value[::-1])
						elif div == 1:
									new_value += str(a__)
									return str(new_value[::-1])

			return new_value[::-1]


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	for base in range(2, 37):
		for num in range(10_00):
			assert int(decimal_to_any(num, base), base) == num, (
			    num,
			    base,
			    decimal_to_any(num, base),
			    int(decimal_to_any(num, base), base),
			)





from __future__ import annotations

# This is the precision for this function which can be altered.
# It is recommended for users to keep this number greater than or equal to 10.
__snake_case				:      Optional[Any]   		=			10


def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__):

			'''simple docstring'''



			for i in range(a__  ,	a__):
						if array[i] == target:
									return i
			return -1


def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			a_						:						Any 							= 0
			a_						:						List[str] 							= len(a__)
			while left <= right:
						if right - left < precision:
									return lin_search(a__  ,	a__  ,	a__  ,	a__)

						a_						:						Dict 							= (left + right) // 3 + 1
						a_						:						Optional[Any] 							= 2 * (left + right) // 3 + 1

						if array[one_third] == target:
									return one_third
						elif array[two_third] == target:
									return two_third

						elif target < array[one_third]:
									a_						:						int 							= one_third - 1
						elif array[two_third] < target:
									a_						:						Any 							= two_third + 1

						else:
									a_						:						Optional[int] 							= one_third + 1
									a_						:						int 							= two_third - 1
			else:
						return -1


def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__):

			'''simple docstring'''



			if left < right:
						if right - left < precision:
									return lin_search(a__  ,	a__  ,	a__  ,	a__)
						a_						:						Optional[int] 							= (left + right) // 3 + 1
						a_						:						Union[str, Any] 							= 2 * (left + right) // 3 + 1

						if array[one_third] == target:
									return one_third
						elif array[two_third] == target:
									return two_third

						elif target < array[one_third]:
									return rec_ternary_search(a__  ,	one_third - 1  ,	a__  ,	a__)
						elif array[two_third] < target:
									return rec_ternary_search(two_third + 1  ,	a__  ,	a__  ,	a__)
						else:
									return rec_ternary_search(one_third + 1  ,	two_third - 1  ,	a__  ,	a__)
			else:
						return -1


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	__snake_case				:      Optional[int]   		=			input("""Enter numbers separated by comma:\n""").strip()
	__snake_case				:      Optional[int]   		=			[int(item.strip()) for item in user_input.split(""",""")]
	assert collection == sorted(collection), F"List must be ordered.\n{collection}."
	__snake_case				:      int   		=			int(input("""Enter the number to be found in the list:\n""").strip())
	__snake_case				:      List[Any]   		=			ite_ternary_search(collection, target)
	__snake_case				:      Optional[int]   		=			rec_ternary_search(0, len(collection) - 1, collection, target)
	if resulta != -1:
		print(F"""Iterative search: {target} found at positions: {resulta}""")
		print(F"""Recursive search: {target} found at positions: {resulta}""")
	else:
		print("""Not found""")


