





'''simple docstring'''

from collections.abc import Generator
from math import sin

def 						__magic_name__       (							__UpperCAmelCase      )						->					bytes:

   '''simple docstring'''







   if len(__UpperCAmelCase      ) != 32:
      raise ValueError("""Input must be of length 32"""      )

   __SCREAMING_SNAKE_CASE      							=       b""""""
   for i in [3, 2, 1, 0]:
      little_endian += string_aa[8 * i : 8 * i + 8]
   return little_endian

def 						__magic_name__       (							__UpperCAmelCase      )						->					bytes:

   '''simple docstring'''







   if i < 0:
      raise ValueError("""Input must be non-negative"""      )

   __SCREAMING_SNAKE_CASE      							=       format(__UpperCAmelCase							,	"""08x"""      )[-8:]
   __SCREAMING_SNAKE_CASE      							=       b""""""
   for i in [3, 2, 1, 0]:
      little_endian_hex += hex_rep[2 * i : 2 * i + 2].encode("""utf-8"""      )
   return little_endian_hex

def 						__magic_name__       (							__UpperCAmelCase      )						->					bytes:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE      							=       b""""""
   for char in message:
      bit_string += format(__UpperCAmelCase							,	"""08b"""      ).encode("""utf-8"""      )
   __SCREAMING_SNAKE_CASE      							=       format(len(__UpperCAmelCase      )							,	"""064b"""      ).encode("""utf-8"""      )

   # Pad bit_string to a multiple of 512 chars
   bit_string += b"1"
   while len(__UpperCAmelCase      ) % 512 != 448:
      bit_string += b"0"
   bit_string += to_little_endian(start_len[32:]      ) + to_little_endian(start_len[:32]      )

   return bit_string

def 						__magic_name__       (							__UpperCAmelCase      )						->					Generator[list[int], None, None]:

   '''simple docstring'''







   if len(__UpperCAmelCase      ) % 512 != 0:
      raise ValueError("""Input must have length that's a multiple of 512"""      )

   for pos in range(0							,	len(__UpperCAmelCase      )							,	512      ):
      __SCREAMING_SNAKE_CASE      							=       bit_string[pos : pos + 512]
      __SCREAMING_SNAKE_CASE      							=       []
      for i in range(0							,	512							,	32      ):
         block_words.append(int(to_little_endian(block[i : i + 32]      )							,	2      )      )
      yield block_words

def 						__magic_name__       (							__UpperCAmelCase      )						->					int:

   '''simple docstring'''







   if i < 0:
      raise ValueError("""Input must be non-negative"""      )

   __SCREAMING_SNAKE_CASE      							=       format(__UpperCAmelCase							,	"""032b"""      )
   __SCREAMING_SNAKE_CASE      							=       """"""
   for c in i_str:
      new_str += "1" if c == "0" else "0"
   return int(__UpperCAmelCase							,	2      )

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase      )						->					int:

   '''simple docstring'''







   return (a + b) % 2**32

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase      )						->					int:

   '''simple docstring'''







   if i < 0:
      raise ValueError("""Input must be non-negative"""      )
   if shift < 0:
      raise ValueError("""Shift must be non-negative"""      )
   return ((i << shift) ^ (i >> (32 - shift))) % 2**32

def 						__magic_name__       (							__UpperCAmelCase      )						->					bytes:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE      							=       preprocess(__UpperCAmelCase      )

   __SCREAMING_SNAKE_CASE      							=       [int(2**32 * abs(sin(i + 1      )      )      ) for i in range(64      )]

   # Starting states
   __SCREAMING_SNAKE_CASE      							=       0X6745_2301
   __SCREAMING_SNAKE_CASE      							=       0XEFCD_AB89
   __SCREAMING_SNAKE_CASE      							=       0X98BA_DCFE
   __SCREAMING_SNAKE_CASE      							=       0X1032_5476

   __SCREAMING_SNAKE_CASE      							=       [
       7,
       12,
       17,
       22,
       7,
       12,
       17,
       22,
       7,
       12,
       17,
       22,
       7,
       12,
       17,
       22,
       5,
       9,
       14,
       20,
       5,
       9,
       14,
       20,
       5,
       9,
       14,
       20,
       5,
       9,
       14,
       20,
       4,
       11,
       16,
       23,
       4,
       11,
       16,
       23,
       4,
       11,
       16,
       23,
       4,
       11,
       16,
       23,
       6,
       10,
       15,
       21,
       6,
       10,
       15,
       21,
       6,
       10,
       15,
       21,
       6,
       10,
       15,
       21,
   ]

   # Process bit string in chunks, each with 16 32-char words
   for block_words in get_block_words(__UpperCAmelCase      ):
      __SCREAMING_SNAKE_CASE      							=       aa
      __SCREAMING_SNAKE_CASE      							=       ba
      __SCREAMING_SNAKE_CASE      							=       ca
      __SCREAMING_SNAKE_CASE      							=       da

      # Hash current chunk
      for i in range(64      ):
         if i <= 15:
            # f = (b & c) | (not_32(b) & d)     # Alternate definition for f
            __SCREAMING_SNAKE_CASE      							=       d ^ (b & (c ^ d))
            __SCREAMING_SNAKE_CASE      							=       i
         elif i <= 31:
            # f = (d & b) | (not_32(d) & c)     # Alternate definition for f
            __SCREAMING_SNAKE_CASE      							=       c ^ (d & (b ^ c))
            __SCREAMING_SNAKE_CASE      							=       (5 * i + 1) % 16
         elif i <= 47:
            __SCREAMING_SNAKE_CASE      							=       b ^ c ^ d
            __SCREAMING_SNAKE_CASE      							=       (3 * i + 5) % 16
         else:
            __SCREAMING_SNAKE_CASE      							=       c ^ (b | not_aa(__UpperCAmelCase      ))
            __SCREAMING_SNAKE_CASE      							=       (7 * i) % 16
         __SCREAMING_SNAKE_CASE      							=       (f + a + added_consts[i] + block_words[g]) % 2**32
         __SCREAMING_SNAKE_CASE      							=       d
         __SCREAMING_SNAKE_CASE      							=       c
         __SCREAMING_SNAKE_CASE      							=       b
         __SCREAMING_SNAKE_CASE      							=       sum_aa(__UpperCAmelCase							,	left_rotate_aa(__UpperCAmelCase							,	shift_amounts[i]      )      )

      # Add hashed chunk to running total
      __SCREAMING_SNAKE_CASE      							=       sum_aa(__UpperCAmelCase							,	__UpperCAmelCase      )
      __SCREAMING_SNAKE_CASE      							=       sum_aa(__UpperCAmelCase							,	__UpperCAmelCase      )
      __SCREAMING_SNAKE_CASE      							=       sum_aa(__UpperCAmelCase							,	__UpperCAmelCase      )
      __SCREAMING_SNAKE_CASE      							=       sum_aa(__UpperCAmelCase							,	__UpperCAmelCase      )

   __SCREAMING_SNAKE_CASE      							=       reformat_hex(__UpperCAmelCase      ) + reformat_hex(__UpperCAmelCase      ) + reformat_hex(__UpperCAmelCase      ) + reformat_hex(__UpperCAmelCase      )
   return digest


if __name__ == "__main__":
    import doctest

    doctest.testmod()












'''simple docstring'''

from __future__ import annotations

import bisect

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase = 0							,	__UpperCAmelCase = -1      )						->					int:

   '''simple docstring'''







   if hi < 0:
      __SCREAMING_SNAKE_CASE      							=       len(__UpperCAmelCase      )

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

   return lo

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase = 0							,	__UpperCAmelCase = -1      )						->					int:

   '''simple docstring'''







   if hi < 0:
      __SCREAMING_SNAKE_CASE      							=       len(__UpperCAmelCase      )

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

   return lo

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase = 0							,	__UpperCAmelCase = -1      )						->					None:

   '''simple docstring'''







   sorted_collection.insert(bisect_left(__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase      )							,	__UpperCAmelCase      )

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase = 0							,	__UpperCAmelCase = -1      )						->					None:

   '''simple docstring'''







   sorted_collection.insert(bisect_right(__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase      )							,	__UpperCAmelCase      )

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase      )						->					int | None:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE      							=       0
   __SCREAMING_SNAKE_CASE      							=       len(__UpperCAmelCase      ) - 1

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

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase      )						->					int | None:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE      							=       bisect.bisect_left(__UpperCAmelCase							,	__UpperCAmelCase      )
   if index != len(__UpperCAmelCase      ) and sorted_collection[index] == item:
      return index
   return None

def 						__magic_name__       (							__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase							,	__UpperCAmelCase      )						->					int | None:

   '''simple docstring'''







   if right < left:
      return None

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

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


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





