
"""simple docstring"""







from collections.abc import Generator
from math import sin
def    __lowerCAmelCase    (_UpperCamelCase		):
	if len(_UpperCamelCase		) != 32:
		raise ValueError('Input must be of length 32'		)

	__lowerCAmelCase      :						List[str]						      =				b''
	for i in [3, 2, 1, 0]:
		little_endian += string_aa[8 * i : 8 * i + 8]
	return little_endian
def    __lowerCAmelCase    (_UpperCamelCase		):
	if i < 0:
		raise ValueError('Input must be non-negative'		)

	__lowerCAmelCase      :						int						      =				format(_UpperCamelCase	,  '08x'		)[-8:]
	__lowerCAmelCase      :						Tuple						      =				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    __lowerCAmelCase    (_UpperCamelCase		):
	__lowerCAmelCase      :						Any						      =				b''
	for char in message:
		bit_string += format(_UpperCamelCase	,  '08b'		).encode('utf-8'		)
	__lowerCAmelCase      :						List[str]						      =				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    __lowerCAmelCase    (_UpperCamelCase		):
	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		):
		__lowerCAmelCase      :						Tuple						      =				bit_string[pos : pos + 512]
		__lowerCAmelCase      :						str						      =				[]
		for i in range(0	,  512	,  32		):
			block_words.append(int(to_little_endian(block[i : i + 32]		)	,  2		)		)
		yield block_words
def    __lowerCAmelCase    (_UpperCamelCase		):
	if i < 0:
		raise ValueError('Input must be non-negative'		)

	__lowerCAmelCase      :						List[str]						      =				format(_UpperCamelCase	,  '032b'		)
	__lowerCAmelCase      :						Union[str, Any]						      =				''
	for c in i_str:
		new_str += "1" if c == "0" else "0"
	return int(_UpperCamelCase	,  2		)
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase		):
	return (a + b) % 2**32
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase		):
	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    __lowerCAmelCase    (_UpperCamelCase		):
	__lowerCAmelCase      :						Dict						      =				preprocess(_UpperCamelCase		)

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

	# Starting states
	__lowerCAmelCase      :						Tuple						      =				0x67452301
	__lowerCAmelCase      :						List[str]						      =				0xEFCDAB89
	__lowerCAmelCase      :						List[str]						      =				0x98BADCFE
	__lowerCAmelCase      :						Optional[Any]						      =				0x10325476

	__lowerCAmelCase      :						Any						      =				[
	    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		):
		__lowerCAmelCase      :						Optional[int]						      =				aa
		__lowerCAmelCase      :						List[str]						      =				ba
		__lowerCAmelCase      :						Dict						      =				ca
		__lowerCAmelCase      :						Optional[int]						      =				da

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

		# Add hashed chunk to running total
		__lowerCAmelCase      :						str						      =				sum_aa(_UpperCamelCase	,  _UpperCamelCase		)
		__lowerCAmelCase      :						Optional[Any]						      =				sum_aa(_UpperCamelCase	,  _UpperCamelCase		)
		__lowerCAmelCase      :						List[str]						      =				sum_aa(_UpperCamelCase	,  _UpperCamelCase		)
		__lowerCAmelCase      :						str						      =				sum_aa(_UpperCamelCase	,  _UpperCamelCase		)

	__lowerCAmelCase      :						Any						      =				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
def    __lowerCAmelCase    (_UpperCamelCase		):
	__lowerCAmelCase      :						List[str]						      =				str(_UpperCamelCase		)
	return len(_UpperCamelCase		) == 9 and set(_UpperCamelCase		) == set('123456789'		)
def    __lowerCAmelCase    ():
	for base_num in range(9999	,  4999	,  -1		):
		__lowerCAmelCase      :						Union[str, Any]						      =				10_0002 * base_num
		if is_9_pandigital(_UpperCamelCase		):
			return candidate

	for base_num in range(333	,  99	,  -1		):
		__lowerCAmelCase      :						Dict						      =				100_2003 * base_num
		if is_9_pandigital(_UpperCamelCase		):
			return candidate

	return None


if __name__ == "__main__":
							print(f'{solution() = }')