






from collections.abc import Generator
from math import sin




def      __A					(     _lowercase ):

					'''simple docstring'''







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

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




def      __A					(     _lowercase ):

					'''simple docstring'''







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

					_A								= format(__UpperCAmelCase					,			'''08x''' )[-8:]
					_A								= 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					(     _lowercase ):

					'''simple docstring'''







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

					# Pad bit_string to a multiple of 512 chars
					bit_string += b"1"
					while len(__UpperCAmelCase ) % 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					(     _lowercase ):

					'''simple docstring'''







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

					for pos in range(0					,			len(__UpperCAmelCase )					,			5_12 ):
										_A								= bit_string[pos : pos + 5_12]
										_A								= []
										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					(     _lowercase ):

					'''simple docstring'''







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

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




def      __A					(     _lowercase					,			_lowercase ):

					'''simple docstring'''







					return (a + b) % 2**32




def      __A					(     _lowercase					,			_lowercase ):

					'''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      __A					(     _lowercase ):

					'''simple docstring'''







					_A								= preprocess(__UpperCAmelCase )

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

					# Starting states
					_A								= 0X67_452_301
					_A								= 0Xef_cda_b89
					_A								= 0X98_bad_cfe
					_A								= 0X10_325_476

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

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

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

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


if __name__ == "__main__":
				import doctest

				doctest.testmod()














def      __A					(     _lowercase					,			_lowercase ):

					'''simple docstring'''







					_A								= word.split()

					def justify(_lowercase					,			_lowercase					,			_lowercase ) -> str:
										_A								= max_width - width
										_A								= len(_lowercase )
										if len(_lowercase ) == 1:
															# if there is only word in line
															# just insert overall_spaces_count for the remainder of line
															return line[0] + " " * overall_spaces_count
										else:
															_A								= words_count - 1
															# num_spaces_between_words_list[i] : tells you to insert
															# num_spaces_between_words_list[i] spaces
															# after word on line[i]
															_A								= spaces_to_insert_between_words * [
															    overall_spaces_count // spaces_to_insert_between_words
															]
															_A								= (
															    overall_spaces_count % spaces_to_insert_between_words
															)
															# distribute spaces via round robin to the left words
															for i in range(_lowercase ):
																				num_spaces_between_words_list[i] += 1
															_A								= []
															for i in range(_lowercase ):
																				# add the word
																				aligned_words_list.append(line[i] )
																				# add the spaces to insert
																				aligned_words_list.append(num_spaces_between_words_list[i] * ''' ''' )
															# just add the last word to the sentence
															aligned_words_list.append(line[-1] )
															# join the aligned words list to form a justified line
															return "".join(_lowercase )

					_A								= []
					_A								= []
					_A								= 0
					for word in words:
										if width + len(_lowercase ) + len(_lowercase ) <= max_width:
															# keep adding words until we can fill out max_width
															# width = sum of length of all words (without overall_spaces_count)
															# len(word) = length of current word
															# len(line) = number of overall_spaces_count to insert between words
															line.append(_lowercase )
															width += len(_lowercase )
										else:
															# justify the line and add it to result
															answer.append(justify(_lowercase					,			_lowercase					,			_lowercase ) )
															# reset new line and new width
															_A							,_A								= [word], len(_lowercase )
					_A								= max_width - width - len(_lowercase )
					answer.append(''' '''.join(_lowercase ) + (remaining_spaces + 1) * ''' ''' )
					return answer


if __name__ == "__main__":
				from doctest import testmod

				testmod()



