'''simple docstring'''


from collections.abc import Generator
from math import sin

def   A_      (       SCREAMING_SNAKE_CASE_						)			->bytes:
  if len(SCREAMING_SNAKE_CASE_						) != 32:
    raise ValueError("""Input must be of length 32"""						)

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

def   A_      (       SCREAMING_SNAKE_CASE_						)			->bytes:
  if i < 0:
    raise ValueError("""Input must be non-negative"""						)

  lowercase_     =       format(SCREAMING_SNAKE_CASE_ ,	"""08x"""						)[-8:]
  lowercase_     =       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   A_      (       SCREAMING_SNAKE_CASE_						)			->bytes:
  lowercase_     =       B""""""
  for char in message:
    bit_string += format(SCREAMING_SNAKE_CASE_ ,	"""08b"""						).encode("""utf-8"""						)
  lowercase_     =       format(len(SCREAMING_SNAKE_CASE_						) ,	"""064b"""						).encode("""utf-8"""						)

  # Pad bit_string to a multiple of 512 chars
  bit_string += b"1"
  while len(SCREAMING_SNAKE_CASE_						) % 5_12 != 4_48:
    bit_string += b"0"
  bit_string += to_little_endian(start_len[32:]						) + to_little_endian(start_len[:32]						)

  return bit_string

def   A_      (       SCREAMING_SNAKE_CASE_						)			->Generator[list[int], None, None]:
  if len(SCREAMING_SNAKE_CASE_						) % 5_12 != 0:
    raise ValueError("""Input must have length that's a multiple of 512"""						)

  for pos in range(0 ,	len(SCREAMING_SNAKE_CASE_						) ,	5_12						):
    lowercase_     =       bit_string[pos : pos + 5_12]
    lowercase_     =       []
    for i in range(0 ,	5_12 ,	32						):
      block_words.append(int(to_little_endian(block[i : i + 32]						) ,	2						)						)
    yield block_words

def   A_      (       SCREAMING_SNAKE_CASE_						)			->int:
  if i < 0:
    raise ValueError("""Input must be non-negative"""						)

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

def   A_      (       SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						)			->int:
  return (a + b) % 2**32

def   A_      (       SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						)			->int:
  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   A_      (       SCREAMING_SNAKE_CASE_						)			->bytes:
  lowercase_     =       preprocess(SCREAMING_SNAKE_CASE_						)

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

  # Starting states
  lowercase_     =       0X6_7_4_5_2_3_0_1
  lowercase_     =       0Xe_f_c_d_a_b_8_9
  lowercase_     =       0X9_8_b_a_d_c_f_e
  lowercase_     =       0X1_0_3_2_5_4_7_6

  lowercase_     =       [
      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(SCREAMING_SNAKE_CASE_						):
    lowercase_     =       aa
    lowercase_     =       ba
    lowercase_     =       ca
    lowercase_     =       da

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

    # Add hashed chunk to running total
    lowercase_     =       sum_aa(SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						)
    lowercase_     =       sum_aa(SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						)
    lowercase_     =       sum_aa(SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						)
    lowercase_     =       sum_aa(SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						)

  lowercase_     =       reformat_hex(SCREAMING_SNAKE_CASE_						) + reformat_hex(SCREAMING_SNAKE_CASE_						) + reformat_hex(SCREAMING_SNAKE_CASE_						) + reformat_hex(SCREAMING_SNAKE_CASE_						)
  return digest


if __name__ == "__main__":
       import doctest

       doctest.testmod()


'''simple docstring'''


import math

def   A_      (       SCREAMING_SNAKE_CASE_						)			->int:

  if not isinstance(SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_						):
    lowercase_     =       f"""Input value of [number={number}] must be an integer"""
    raise TypeError(SCREAMING_SNAKE_CASE_						)

  if number < 1:
    lowercase_     =       f"""Input value of [number={number}] must be > 0"""
    raise ValueError(SCREAMING_SNAKE_CASE_						)
  elif number == 1:
    return 3
  elif number == 2:
    return 5
  else:
    lowercase_     =       int(math.log(number // 3 ,	2						)						) + 2

    lowercase_     =       [3, 5]
    lowercase_     =       2
    lowercase_     =       3
    for block in range(1 ,	SCREAMING_SNAKE_CASE_						):
      for _ in range(SCREAMING_SNAKE_CASE_						):
        proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1]						)
        proth_index += 1
      increment *= 2

  return proth_list[number - 1]


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       for number in range(11):
              __snake_case						  =		0
              try:
                     __snake_case						  =		proth(number)
              except ValueError:
                     print(f'''ValueError: there is no {number}th Proth number''')
                     continue

              print(f'''The {number}th Proth number: {value}''')

