





"""simple docstring"""
from __future__ import annotations

import bisect



def      __lowerCamelCase   (							a_     :		list[int] ,   a_     :		int ,   a_     :		int = 0 ,   a_     :		int = -1							)			->      int:
      if hi < 0:
            __SCREAMING_SNAKE_CASE   :List[Any]						=  len(a_							)

      while lo < hi:
            __SCREAMING_SNAKE_CASE   :Tuple						=  lo + (hi - lo) // 2
            if sorted_collection[mid] < item:
                  __SCREAMING_SNAKE_CASE   :Optional[Any]						=  mid + 1
            else:
                  __SCREAMING_SNAKE_CASE   :Union[str, Any]						=  mid

      return lo



def      __lowerCamelCase   (							a_     :		list[int] ,   a_     :		int ,   a_     :		int = 0 ,   a_     :		int = -1							)			->      int:
      if hi < 0:
            __SCREAMING_SNAKE_CASE   :List[str]						=  len(a_							)

      while lo < hi:
            __SCREAMING_SNAKE_CASE   :List[str]						=  lo + (hi - lo) // 2
            if sorted_collection[mid] <= item:
                  __SCREAMING_SNAKE_CASE   :int						=  mid + 1
            else:
                  __SCREAMING_SNAKE_CASE   :List[Any]						=  mid

      return lo



def      __lowerCamelCase   (							a_     :		list[int] ,   a_     :		int ,   a_     :		int = 0 ,   a_     :		int = -1							)			->      None:
      sorted_collection.insert(bisect_left(a_ ,   a_ ,   a_ ,   a_							) ,   a_							)



def      __lowerCamelCase   (							a_     :		list[int] ,   a_     :		int ,   a_     :		int = 0 ,   a_     :		int = -1							)			->      None:
      sorted_collection.insert(bisect_right(a_ ,   a_ ,   a_ ,   a_							) ,   a_							)



def      __lowerCamelCase   (							a_     :		list[int] ,   a_     :		int							)			->      int | None:
      __SCREAMING_SNAKE_CASE   :Dict						=  0
      __SCREAMING_SNAKE_CASE   :str						=  len(a_							) - 1

      while left <= right:
            __SCREAMING_SNAKE_CASE   :List[Any]						=  left + (right - left) // 2
            __SCREAMING_SNAKE_CASE   :List[Any]						=  sorted_collection[midpoint]
            if current_item == item:
                  return midpoint
            elif item < current_item:
                  __SCREAMING_SNAKE_CASE   :List[str]						=  midpoint - 1
            else:
                  __SCREAMING_SNAKE_CASE   :Dict						=  midpoint + 1
      return None



def      __lowerCamelCase   (							a_     :		list[int] ,   a_     :		int							)			->      int | None:
      __SCREAMING_SNAKE_CASE   :str						=  bisect.bisect_left(a_ ,   a_							)
      if index != len(a_							) and sorted_collection[index] == item:
            return index
      return None



def      __lowerCamelCase   (							a_     :		list[int] ,   a_     :		int ,   a_     :		int ,   a_     :		int							)			->      int | None:
      if right < left:
            return None

      __SCREAMING_SNAKE_CASE   :List[str]						=  left + (right - left) // 2

      if sorted_collection[midpoint] == item:
            return midpoint
      elif sorted_collection[midpoint] > item:
            return binary_search_by_recursion(a_ ,   a_ ,   a_ ,   midpoint - 1							)
      else:
            return binary_search_by_recursion(a_ ,   a_ ,   midpoint + 1 ,   a_							)


if __name__ == "__main__":
  lowerCamelCase_								=		input("Enter numbers separated by comma:\n").strip()
  lowerCamelCase_								=		sorted(int(item) for item in user_input.split(","))
  lowerCamelCase_								=		int(input("Enter a single number to be found in the list:\n"))
  lowerCamelCase_								=		binary_search(collection, target)
  if result is None:
    print(f'{target} was not found in {collection}.')
  else:
    print(f'{target} was found at position {result} in {collection}.')






"""simple docstring"""
def      __lowerCamelCase   (							a_     :		int							)			->      bool:
      if not isinstance(a_ ,   a_							):
            __SCREAMING_SNAKE_CASE   :int						=  f'''Input value of [number={number}] must be an integer'''
            raise TypeError(a_							)
      if number < 0:
            return False
      __SCREAMING_SNAKE_CASE   :Any						=  number * number
      while number > 0:
            if number % 10 != number_square % 10:
                  return False
            number //= 10
            number_square //= 10
      return True


if __name__ == "__main__":
  import doctest

  doctest.testmod()