



'''simple docstring'''
from collections.abc import Generator
from math import sin






def A__       (	UpperCAmelCase_				):
						if len(UpperCAmelCase_				) != 3_2:
												raise ValueError('Input must be of length 32'				)

						_UpperCamelCase   :						int												=  b''
						for i in [3, 2, 1, 0]:
												little_endian += string_aa[8 * i : 8 * i + 8]
						return little_endian






def A__       (	UpperCAmelCase_				):
						if i < 0:
												raise ValueError('Input must be non-negative'				)

						_UpperCamelCase   :						Optional[int]												=  format(UpperCAmelCase_    ,    '08x'				)[-8:]
						_UpperCamelCase   :						str												=  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__       (	UpperCAmelCase_				):
						_UpperCamelCase   :						int												=  b''
						for char in message:
												bit_string += format(UpperCAmelCase_    ,    '08b'				).encode('utf-8'				)
						_UpperCamelCase   :						Any												=  format(len(UpperCAmelCase_				)    ,    '064b'				).encode('utf-8'				)

						# Pad bit_string to a multiple of 512 chars
						bit_string += b"1"
						while len(UpperCAmelCase_				) % 5_1_2 != 4_4_8:
												bit_string += b"0"
						bit_string += to_little_endian(start_len[3_2:]				) + to_little_endian(start_len[:3_2]				)

						return bit_string






def A__       (	UpperCAmelCase_				):
						if len(UpperCAmelCase_				) % 5_1_2 != 0:
												raise ValueError('Input must have length that\'s a multiple of 512'				)

						for pos in range(0    ,    len(UpperCAmelCase_				)    ,    5_1_2				):
												_UpperCamelCase   :						Optional[int]												=  bit_string[pos : pos + 5_1_2]
												_UpperCamelCase   :						Optional[Any]												=  []
												for i in range(0    ,    5_1_2    ,    3_2				):
																		block_words.append(int(to_little_endian(block[i : i + 3_2]				)    ,    2				)				)
												yield block_words






def A__       (	UpperCAmelCase_				):
						if i < 0:
												raise ValueError('Input must be non-negative'				)

						_UpperCamelCase   :						Any												=  format(UpperCAmelCase_    ,    '032b'				)
						_UpperCamelCase   :						List[str]												=  ''
						for c in i_str:
												new_str += "1" if c == "0" else "0"
						return int(UpperCAmelCase_    ,    2				)






def A__       (	UpperCAmelCase_    ,    UpperCAmelCase_				):
						return (a + b) % 2**3_2






def A__       (	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 >> (3_2 - shift))) % 2**3_2






def A__       (	UpperCAmelCase_				):
						_UpperCamelCase   :						str												=  preprocess(UpperCAmelCase_				)

						_UpperCamelCase   :						List[Any]												=  [int(2**3_2 * abs(sin(i + 1				)				)				) for i in range(6_4				)]

						# Starting states
						_UpperCamelCase   :						Tuple												=  0X67_452_301
						_UpperCamelCase   :						Any												=  0XEF_CDA_B89
						_UpperCamelCase   :						List[str]												=  0X98_BAD_CFE
						_UpperCamelCase   :						Optional[Any]												=  0X10_325_476

						_UpperCamelCase   :						Dict												=  [
						    7,
						    1_2,
						    1_7,
						    2_2,
						    7,
						    1_2,
						    1_7,
						    2_2,
						    7,
						    1_2,
						    1_7,
						    2_2,
						    7,
						    1_2,
						    1_7,
						    2_2,
						    5,
						    9,
						    1_4,
						    2_0,
						    5,
						    9,
						    1_4,
						    2_0,
						    5,
						    9,
						    1_4,
						    2_0,
						    5,
						    9,
						    1_4,
						    2_0,
						    4,
						    1_1,
						    1_6,
						    2_3,
						    4,
						    1_1,
						    1_6,
						    2_3,
						    4,
						    1_1,
						    1_6,
						    2_3,
						    4,
						    1_1,
						    1_6,
						    2_3,
						    6,
						    1_0,
						    1_5,
						    2_1,
						    6,
						    1_0,
						    1_5,
						    2_1,
						    6,
						    1_0,
						    1_5,
						    2_1,
						    6,
						    1_0,
						    1_5,
						    2_1,
						]

						# Process bit string in chunks, each with 16 32-char words
						for block_words in get_block_words(UpperCAmelCase_				):
												_UpperCamelCase   :						str												=  aa
												_UpperCamelCase   :						Any												=  ba
												_UpperCamelCase   :						Union[str, Any]												=  ca
												_UpperCamelCase   :						Tuple												=  da

												# Hash current chunk
												for i in range(6_4				):
																		if i <= 1_5:
																								# f = (b & c) | (not_32(b) & d)     # Alternate definition for f
																								_UpperCamelCase   :						List[Any]												=  d ^ (b & (c ^ d))
																								_UpperCamelCase   :						Any												=  i
																		elif i <= 3_1:
																								# f = (d & b) | (not_32(d) & c)     # Alternate definition for f
																								_UpperCamelCase   :						List[Any]												=  c ^ (d & (b ^ c))
																								_UpperCamelCase   :						str												=  (5 * i + 1) % 1_6
																		elif i <= 4_7:
																								_UpperCamelCase   :						List[Any]												=  b ^ c ^ d
																								_UpperCamelCase   :						Optional[int]												=  (3 * i + 5) % 1_6
																		else:
																								_UpperCamelCase   :						List[Any]												=  c ^ (b | not_aa(UpperCAmelCase_				))
																								_UpperCamelCase   :						Dict												=  (7 * i) % 1_6
																		_UpperCamelCase   :						Optional[int]												=  (f + a + added_consts[i] + block_words[g]) % 2**3_2
																		_UpperCamelCase   :						Tuple												=  d
																		_UpperCamelCase   :						int												=  c
																		_UpperCamelCase   :						List[str]												=  b
																		_UpperCamelCase   :						Optional[Any]												=  sum_aa(UpperCAmelCase_    ,    left_rotate_aa(UpperCAmelCase_    ,    shift_amounts[i]				)				)

												# Add hashed chunk to running total
												_UpperCamelCase   :						Tuple												=  sum_aa(UpperCAmelCase_    ,    UpperCAmelCase_				)
												_UpperCamelCase   :						List[Any]												=  sum_aa(UpperCAmelCase_    ,    UpperCAmelCase_				)
												_UpperCamelCase   :						int												=  sum_aa(UpperCAmelCase_    ,    UpperCAmelCase_				)
												_UpperCamelCase   :						Optional[int]												=  sum_aa(UpperCAmelCase_    ,    UpperCAmelCase_				)

						_UpperCamelCase   :						Any												=  reformat_hex(UpperCAmelCase_				) + reformat_hex(UpperCAmelCase_				) + reformat_hex(UpperCAmelCase_				) + reformat_hex(UpperCAmelCase_				)
						return digest


if __name__ == "__main__":
					import doctest

					doctest.testmod()







'''simple docstring'''
def A__       (	UpperCAmelCase_ = 6_0_0_8_5_1_4_7_5_1_4_3				):

						try:
												_UpperCamelCase   :						str												=  int(UpperCAmelCase_				)
						except (TypeError, ValueError):
												raise TypeError('Parameter n must be int or castable to int.'				)
						if n <= 0:
												raise ValueError('Parameter n must be greater than or equal to one.'				)
						_UpperCamelCase   :						int												=  1
						_UpperCamelCase   :						Optional[Any]												=  2
						while i * i <= n:
												while n % i == 0:
																		_UpperCamelCase   :						Union[str, Any]												=  i
																		n //= i
												i += 1
						if n > 1:
												_UpperCamelCase   :						Dict												=  n
						return int(UpperCAmelCase_				)


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


