
"""simple docstring"""




import math



class 			lowerCAmelCase_		:


				"""simple docstring"""



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



											"""simple docstring"""




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



				def 			__magic_name__					(self     , SCREAMING_SNAKE_CASE__     , SCREAMING_SNAKE_CASE__     , SCREAMING_SNAKE_CASE__					)      ->	str:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: int     =     w



				def 			__magic_name__					(self					)      ->	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__		: Tuple     =     min(self.dp[i][j]     , self.dp[i][k] + self.dp[k][j]					)



				def 			__magic_name__					(self     , SCREAMING_SNAKE_CASE__     , SCREAMING_SNAKE_CASE__					)      ->	List[str]:



											"""simple docstring"""




											return self.dp[u][v]


if __name__ == "__main__":
					UpperCAmelCase__   :					Optional[Any]												=				Graph(5)
					graph.add_edge(0, 2, 9)
					graph.add_edge(0, 4, 1_0)
					graph.add_edge(1, 3, 5)
					graph.add_edge(2, 3, 7)
					graph.add_edge(3, 0, 1_0)
					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)






"""simple docstring"""




def lowercase_						(     _snake_case     ,_snake_case		):
							return int((input_a, input_a).count(1		) != 0		)

def lowercase_						(     ):
							assert or_gate(0     ,0		) == 0
							assert or_gate(0     ,1		) == 1
							assert or_gate(1     ,0		) == 1
							assert or_gate(1     ,1		) == 1


if __name__ == "__main__":
					print(or_gate(0, 1))
					print(or_gate(1, 0))
					print(or_gate(0, 0))
					print(or_gate(1, 1))




