


import math







class      lowerCAmelCase__       :




     '''simple docstring'''


     def __init__(						self ,						__lowerCamelCase=0)			->				str:  # a graph with Node 0,1,...,N-1
            _A      :       Tuple				    = n
            _A      :       Optional[int]				    = [
                [math.inf for j in range(0 ,						__lowerCamelCase)] for i in range(0 ,						__lowerCamelCase)
            ]  # adjacency matrix for weight
            _A      :       List[str]				    = [
                [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 ,						__lowerCamelCase ,						__lowerCamelCase ,						__lowerCamelCase)			->				int:
            _A      :       Dict				    = w


     def  _lowerCamelCase (						self)			->				Union[str, Any]:
            for k in range(0 ,						self.n):
                   for i in range(0 ,						self.n):
                          for j in range(0 ,						self.n):
                                 _A      :       Optional[Any]				    = min(self.dp[i][j] ,						self.dp[i][k] + self.dp[k][j])


     def  _lowerCamelCase (						self ,						__lowerCamelCase ,						__lowerCamelCase)			->				Optional[int]:
            return self.dp[u][v]


if __name__ == "__main__":
    lowerCAmelCase__      		= 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)




def 							_UpperCAmelCase				(UpperCamelCase__     :  str				,							UpperCamelCase__     :  bool = False						):

       if not isinstance(UpperCamelCase__				,							UpperCamelCase__						):
              _A      :       Optional[Any]				    = f"Expected string as input, found {type(UpperCamelCase__						)}"
              raise ValueError(UpperCamelCase__						)
       if not isinstance(UpperCamelCase__				,							UpperCamelCase__						):
              _A      :       Union[str, Any]				    = f"Expected boolean as use_pascal parameter, found {type(UpperCamelCase__						)}"
              raise ValueError(UpperCamelCase__						)

       _A      :       int				    = input_str.split("_"						)

       _A      :       str				    = 0 if use_pascal else 1

       _A      :       str				    = words[start_index:]

       _A      :       Optional[Any]				    = [word[0].upper() + word[1:] for word in words_to_capitalize]

       _A      :       Any				    = "" if use_pascal else words[0]

       return "".join([initial_word, *capitalized_words]						)


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

    testmod()
