
"""simple docstring"""






from collections.abc import Generator
from math import sin





def __A						(   a_ :							bytes     )->							bytes:




		'''simple docstring'''






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

		SCREAMING_SNAKE_CASE       :     str				= B''''''
		for i in [3, 2, 1, 0]:
				little_endian += string_aa[8 * i : 8 * i + 8]
		return little_endian





def __A						(   a_ :							int     )->							bytes:




		'''simple docstring'''






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

		SCREAMING_SNAKE_CASE       :     Tuple				= format(a_		,		'''08x'''     )[-8:]
		SCREAMING_SNAKE_CASE       :     int				= 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						(   a_ :							bytes     )->							bytes:




		'''simple docstring'''






		SCREAMING_SNAKE_CASE       :     Dict				= B''''''
		for char in message:
				bit_string += format(a_		,		'''08b'''     ).encode('''utf-8'''     )
		SCREAMING_SNAKE_CASE       :     int				= format(len(a_     )		,		'''064b'''     ).encode('''utf-8'''     )

		# Pad bit_string to a multiple of 512 chars
		bit_string += b"1"
		while len(a_     ) % 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						(   a_ :							bytes     )->							Generator[list[int], None, None]:




		'''simple docstring'''






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

		for pos in range(0		,		len(a_     )		,		5_12     ):
				SCREAMING_SNAKE_CASE       :     List[str]				= bit_string[pos : pos + 5_12]
				SCREAMING_SNAKE_CASE       :     Optional[int]				= []
				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						(   a_ :							int     )->							int:




		'''simple docstring'''






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

		SCREAMING_SNAKE_CASE       :     Optional[int]				= format(a_		,		'''032b'''     )
		SCREAMING_SNAKE_CASE       :     Optional[int]				= ''''''
		for c in i_str:
				new_str += "1" if c == "0" else "0"
		return int(a_		,		2     )





def __A						(   a_ :							int		,		a_ :							int     )->							int:




		'''simple docstring'''






		return (a + b) % 2**32





def __A						(   a_ :							int		,		a_ :							int     )->							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 __A						(   a_ :							bytes     )->							bytes:




		'''simple docstring'''






		SCREAMING_SNAKE_CASE       :     Dict				= preprocess(a_     )

		SCREAMING_SNAKE_CASE       :     List[Any]				= [int(2**32 * abs(sin(i + 1     )     )     ) for i in range(64     )]

		# Starting states
		SCREAMING_SNAKE_CASE       :     Dict				= 0x67_45_23_01
		SCREAMING_SNAKE_CASE       :     Tuple				= 0xEF_CD_AB_89
		SCREAMING_SNAKE_CASE       :     str				= 0x98_BA_DC_FE
		SCREAMING_SNAKE_CASE       :     List[Any]				= 0x10_32_54_76

		SCREAMING_SNAKE_CASE       :     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(a_     ):
				SCREAMING_SNAKE_CASE       :     Dict				= aa
				SCREAMING_SNAKE_CASE       :     Optional[Any]				= ba
				SCREAMING_SNAKE_CASE       :     Tuple				= ca
				SCREAMING_SNAKE_CASE       :     Any				= 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       :     str				= d ^ (b & (c ^ d))
								SCREAMING_SNAKE_CASE       :     Optional[Any]				= i
						elif i <= 31:
								# f = (d & b) | (not_32(d) & c)     # Alternate definition for f
								SCREAMING_SNAKE_CASE       :     List[Any]				= c ^ (d & (b ^ c))
								SCREAMING_SNAKE_CASE       :     Optional[int]				= (5 * i + 1) % 16
						elif i <= 47:
								SCREAMING_SNAKE_CASE       :     List[Any]				= b ^ c ^ d
								SCREAMING_SNAKE_CASE       :     Union[str, Any]				= (3 * i + 5) % 16
						else:
								SCREAMING_SNAKE_CASE       :     Union[str, Any]				= c ^ (b | not_aa(a_     ))
								SCREAMING_SNAKE_CASE       :     Optional[Any]				= (7 * i) % 16
						SCREAMING_SNAKE_CASE       :     Dict				= (f + a + added_consts[i] + block_words[g]) % 2**32
						SCREAMING_SNAKE_CASE       :     int				= d
						SCREAMING_SNAKE_CASE       :     Union[str, Any]				= c
						SCREAMING_SNAKE_CASE       :     Any				= b
						SCREAMING_SNAKE_CASE       :     List[Any]				= sum_aa(a_		,		left_rotate_aa(a_		,		shift_amounts[i]     )     )

				# Add hashed chunk to running total
				SCREAMING_SNAKE_CASE       :     str				= sum_aa(a_		,		a_     )
				SCREAMING_SNAKE_CASE       :     str				= sum_aa(a_		,		a_     )
				SCREAMING_SNAKE_CASE       :     Dict				= sum_aa(a_		,		a_     )
				SCREAMING_SNAKE_CASE       :     Dict				= sum_aa(a_		,		a_     )

		SCREAMING_SNAKE_CASE       :     int				= reformat_hex(a_     ) + reformat_hex(a_     ) + reformat_hex(a_     ) + reformat_hex(a_     )
		return digest


if __name__ == "__main__":
					import doctest

					doctest.testmod()







"""simple docstring"""






import math




class 				lowercase__:
	'''simple docstring'''

	def __init__(						self    :Union[str, Any]		, lowerCamelCase_    :List[str]=0					)							->			List[Any]:  # a graph with Node 0,1,...,N-1







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Tuple				= n
			SCREAMING_SNAKE_CASE       :     List[Any]				= [
			    [math.inf for j in range(0		, lowerCamelCase_					)] for i in range(0		, lowerCamelCase_					)
			]  # adjacency matrix for weight
			SCREAMING_SNAKE_CASE       :     Any				= [
			    [math.inf for j in range(0		, lowerCamelCase_					)] for i in range(0		, lowerCamelCase_					)
			]  # dp[i][j] stores minimum distance from i to j





	def   __lowerCAmelCase (						self    :Dict		, lowerCamelCase_    :Optional[int]		, lowerCamelCase_    :Union[str, Any]		, lowerCamelCase_    :Union[str, Any]					)							->			Tuple:







			'''simple docstring'''




			SCREAMING_SNAKE_CASE       :     Optional[Any]				= w





	def   __lowerCAmelCase (						self    :str					)							->			Union[str, Any]:







			'''simple docstring'''




			for k in range(0		, self.n					):
					for i in range(0		, self.n					):
							for j in range(0		, self.n					):
									SCREAMING_SNAKE_CASE       :     List[str]				= min(self.dp[i][j]		, self.dp[i][k] + self.dp[k][j]					)







	def   __lowerCAmelCase (						self    :int		, lowerCamelCase_    :Union[str, Any]		, lowerCamelCase_    :Optional[int]					)							->			Optional[Any]:







			'''simple docstring'''




			return self.dp[u][v]


if __name__ == "__main__":
					lowerCamelCase__ :       Dict						     =			Graph(5)
					graph.add_edge(0, 2, 9)
					graph.add_edge(0, 4, 10)
					graph.add_edge(1, 3, 5)
					graph.add_edge(2, 3, 7)
					graph.add_edge(3, 0, 10)
					graph.add_edge(3, 1, 2)
					graph.add_edge(3, 2, 1)
					graph.add_edge(3, 4, 6)
					graph.add_edge(4, 1, 3)
					graph.add_edge(4, 2, 4)
					graph.add_edge(4, 3, 9)
					graph.floyd_warshall()
					graph.show_min(1, 4)
					graph.show_min(0, 3)





