


import math
import sys



def 			lowerCAmelCase (		lowerCAmelCase_ )-> int:
				if number != int(lowerCAmelCase_ ):
								raise ValueError('''the value of input must be a natural number''' )
				if number < 0:
								raise ValueError('''the value of input must not be a negative number''' )
				if number == 0:
								return 1
				lowerCAmelCase_ :      str    				=				[-1] * (number + 1)
				lowerCAmelCase_ :      Optional[Any]    				=				0
				for i in range(1 ,   number + 1 ):
								lowerCAmelCase_ :      List[str]    				=				sys.maxsize
								lowerCAmelCase_ :      Tuple    				=				int(math.sqrt(lowerCAmelCase_ ) )
								for j in range(1 ,   root + 1 ):
												lowerCAmelCase_ :      str    				=				1 + answers[i - (j**2)]
												lowerCAmelCase_ :      Tuple    				=				min(lowerCAmelCase_ ,   lowerCAmelCase_ )
								lowerCAmelCase_ :      Tuple    				=				answer
				return answers[number]


if __name__ == "__main__":
						import doctest

						doctest.testmod()



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.
_UpperCAmelCase			:  Tuple     =10



def 			lowerCAmelCase (		lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ )-> int:
				for i in range(lowerCAmelCase_ ,   lowerCAmelCase_ ):
								if array[i] == target:
												return i
				return -1



def 			lowerCAmelCase (		lowerCAmelCase_ ,   lowerCAmelCase_ )-> int:
				lowerCAmelCase_ :      Any    				=				0
				lowerCAmelCase_ :      int    				=				len(lowerCAmelCase_ )
				while left <= right:
								if right - left < precision:
												return lin_search(lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ )

								lowerCAmelCase_ :      List[Any]    				=				(left + right) // 3 + 1
								lowerCAmelCase_ :      List[str]    				=				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]:
												lowerCAmelCase_ :      Dict    				=				one_third - 1
								elif array[two_third] < target:
												lowerCAmelCase_ :      List[Any]    				=				two_third + 1

								else:
												lowerCAmelCase_ :      Union[str, Any]    				=				one_third + 1
												lowerCAmelCase_ :      Tuple    				=				two_third - 1
				else:
								return -1



def 			lowerCAmelCase (		lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ )-> int:
				if left < right:
								if right - left < precision:
												return lin_search(lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ )
								lowerCAmelCase_ :      Union[str, Any]    				=				(left + right) // 3 + 1
								lowerCAmelCase_ :      Optional[int]    				=				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(lowerCAmelCase_ ,   one_third - 1 ,   lowerCAmelCase_ ,   lowerCAmelCase_ )
								elif array[two_third] < target:
												return rec_ternary_search(two_third + 1 ,   lowerCAmelCase_ ,   lowerCAmelCase_ ,   lowerCAmelCase_ )
								else:
												return rec_ternary_search(one_third + 1 ,   two_third - 1 ,   lowerCAmelCase_ ,   lowerCAmelCase_ )
				else:
								return -1


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						_UpperCAmelCase			:  Tuple     =input("""Enter numbers separated by comma:\n""").strip()
						_UpperCAmelCase			:  Union[str, Any]     =[int(item.strip()) for item in user_input.split(""",""")]
						assert collection == sorted(collection), f"List must be ordered.\n{collection}."
						_UpperCAmelCase			:  int     =int(input("""Enter the number to be found in the list:\n""").strip())
						_UpperCAmelCase			:  Optional[Any]     =ite_ternary_search(collection, target)
						_UpperCAmelCase			:  List[str]     =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""")