
from __future__ import annotations




def        __UpperCamelCase					(    lowerCAmelCase__							:    list[int]  ):
	if len(lowerCAmelCase__  ) == 0:
		return array

	__a			:  Optional[int]		    =  min(lowerCAmelCase__  ), max(lowerCAmelCase__  )

	# Compute the variables
	__a			:  str		    =  _max - _min + 1
	__a			:  Optional[Any]		    =  [0] * holes_range, [0] * holes_range

	# Make the sorting.
	for i in array:
		__a			:  int		    =  i - _min
		__a			:  str		    =  i
		holes_repeat[index] += 1

	# Makes the array back by replacing the numbers.
	__a			:  Tuple		    =  0
	for i in range(lowerCAmelCase__  ):
		while holes_repeat[i] > 0:
			__a			:  Tuple		    =  holes[i]
			index += 1
			holes_repeat[i] -= 1

			 # Returns the sorted array.
	return array


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						lowercase__          =input('Enter numbers separated by comma:\n')
						lowercase__          =[int(x) for x in user_input.split(',')]
						print(pigeon_sort(unsorted))


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.
lowercase__          =10




def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    list[int]  ,       lowerCAmelCase__							:    int  ):
 for i in range(lowerCAmelCase__  ,       lowerCAmelCase__  ):
  if array[i] == target:
   return i
 return -1




def        __UpperCamelCase					(    lowerCAmelCase__							:    list[int]  ,       lowerCAmelCase__							:    int  ):
 __a			:  List[Any]		    =  0
 __a			:  Union[str, Any]		    =  len(lowerCAmelCase__  )
 while left <= right:
  if right - left < precision:
   return lin_search(lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  )

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

  else:
   __a			:  Dict		    =  one_third + 1
   __a			:  Any		    =  two_third - 1
 else:
  return -1




def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    list[int]  ,       lowerCAmelCase__							:    int  ):
 if left < right:
  if right - left < precision:
   return lin_search(lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  )
  __a			:  Union[str, Any]		    =  (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]:
   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()

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