





from __future__ import annotations

import bisect




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE = 0	,		_SCREAMING_SNAKE_CASE = -1	)       ->     int:
  if hi < 0:
    lowercase__			    =						len(_SCREAMING_SNAKE_CASE	)

  while lo < hi:
    lowercase__			    =						lo + (hi - lo) // 2
    if sorted_collection[mid] < item:
      lowercase__			    =						mid + 1
    else:
      lowercase__			    =						mid

  return lo




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE = 0	,		_SCREAMING_SNAKE_CASE = -1	)       ->     int:
  if hi < 0:
    lowercase__			    =						len(_SCREAMING_SNAKE_CASE	)

  while lo < hi:
    lowercase__			    =						lo + (hi - lo) // 2
    if sorted_collection[mid] <= item:
      lowercase__			    =						mid + 1
    else:
      lowercase__			    =						mid

  return lo




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE = 0	,		_SCREAMING_SNAKE_CASE = -1	)       ->     None:
  sorted_collection.insert(bisect_left(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)	,		_SCREAMING_SNAKE_CASE	)




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE = 0	,		_SCREAMING_SNAKE_CASE = -1	)       ->     None:
  sorted_collection.insert(bisect_right(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)	,		_SCREAMING_SNAKE_CASE	)




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     int | None:
  lowercase__			    =						0
  lowercase__			    =						len(_SCREAMING_SNAKE_CASE	) - 1

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




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     int | None:
  lowercase__			    =						bisect.bisect_left(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)
  if index != len(_SCREAMING_SNAKE_CASE	) and sorted_collection[index] == item:
    return index
  return None




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     int | None:
  if right < left:
    return None

  lowercase__			    =						left + (right - left) // 2

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


if __name__ == "__main__":
 lowercase_					     =	input("""Enter numbers separated by comma:\n""").strip()
 lowercase_					     =	sorted(int(item) for item in user_input.split(""","""))
 lowercase_					     =	int(input("""Enter a single number to be found in the list:\n"""))
 lowercase_					     =	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}.''')









from string import ascii_uppercase

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




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     str:
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('int() can\'t convert non-string with explicit base'	)
  if num < 0:
    raise ValueError('parameter must be positive int'	)
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('\'str\' object cannot be interpreted as an integer'	)
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('\'float\' object cannot be interpreted as an integer'	)
  if base in (0, 1):
    raise ValueError('base must be >= 2'	)
  if base > 36:
    raise ValueError('base must be <= 36'	)
  lowercase__			    =						''
  lowercase__			    =						0
  lowercase__			    =						0
  while div != 1:
    lowercase__    ,					lowercase__			    =						divmod(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)
    if base >= 11 and 9 < mod < 36:
      lowercase__			    =						ALPHABET_VALUES[str(_SCREAMING_SNAKE_CASE	)]
    else:
      lowercase__			    =						str(_SCREAMING_SNAKE_CASE	)
    new_value += actual_value
    lowercase__			    =						num // base
    lowercase__			    =						div
    if div == 0:
      return str(new_value[::-1]	)
    elif div == 1:
      new_value += str(_SCREAMING_SNAKE_CASE	)
      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(1_000):
                  assert int(decimal_to_any(num, base), base) == num, (
                      num,
                      base,
                      decimal_to_any(num, base),
                      int(decimal_to_any(num, base), base),
                  )


