




# Lint as: python3
import itertools
import os
import re


UpperCAmelCase_									=	re.compile(r'([A-Z]+)([A-Z][a-z])')
UpperCAmelCase_									=	re.compile(r'([a-z\d])([A-Z])')

UpperCAmelCase_									=	re.compile(r'(?<!_)_(?!_)')
UpperCAmelCase_									=	re.compile(r'(_{2,})')

UpperCAmelCase_									=	r'^\w+(\.\w+)*$'

UpperCAmelCase_									=	r'<>:/\|?*'




def 					lowerCamelCase__       (						A__       :					Dict	):





       '''simple docstring'''



       __lowerCamelCase   =						_uppercase_uppercase_re.sub(R"""\1_\2"""  ,			A__	)
       __lowerCamelCase   =						_lowercase_uppercase_re.sub(R"""\1_\2"""  ,			A__	)
       return name.lower()




def 					lowerCamelCase__       (						A__       :					str	):





       '''simple docstring'''



       __lowerCamelCase   =						_single_underscore_re.split(A__	)
       __lowerCamelCase   =						[_multiple_underscores_re.split(A__	) for n in name]
       return "".join(n.capitalize() for n in itertools.chain.from_iterable(A__	) if n != """"""	)




def 					lowerCamelCase__       (						A__       :					Optional[Any]	):





       '''simple docstring'''



       if os.path.basename(A__	) != name:
              raise ValueError(f'Should be a dataset name, not a path: {name}'	)
       return camelcase_to_snakecase(A__	)




def 					lowerCamelCase__       (						A__       :					Dict  ,			A__       :					Dict	):





       '''simple docstring'''



       if os.path.basename(A__	) != name:
              raise ValueError(f'Should be a dataset name, not a path: {name}'	)
       if not re.match(_split_re  ,			A__	):
              raise ValueError(f'Split name should match \'{_split_re}\'\' but got \'{split}\'.'	)
       return f'{filename_prefix_for_name(A__	)}-{split}'




def 					lowerCamelCase__       (						A__       :					int  ,			A__       :					Tuple  ,			A__       :					Optional[Any]  ,			A__       :					str=None	):





       '''simple docstring'''



       __lowerCamelCase   =						filename_prefix_for_split(A__  ,			A__	)
       if filetype_suffix:
              prefix += f'.{filetype_suffix}'
       __lowerCamelCase   =						os.path.join(A__  ,			A__	)
       return f'{filepath}*'




def 					lowerCamelCase__       (						A__       :					List[str]  ,			A__       :					List[Any]  ,			A__       :					int  ,			A__       :					int=None  ,			A__       :					Any=None	):





       '''simple docstring'''



       __lowerCamelCase   =						filename_prefix_for_split(A__  ,			A__	)
       __lowerCamelCase   =						os.path.join(A__  ,			A__	)

       if shard_lengths:
              __lowerCamelCase   =						len(A__	)
              __lowerCamelCase   =						[f'{prefix}-{shard_id:05d}-of-{num_shards:05d}' for shard_id in range(A__	)]
              if filetype_suffix:
                     __lowerCamelCase   =						[filename + f'.{filetype_suffix}' for filename in filenames]
              return filenames
       else:
              __lowerCamelCase   =						prefix
              if filetype_suffix:
                     filename += f'.{filetype_suffix}'
              return [filename]






'''simple docstring'''





import math






class __A			:



 '''simple docstring'''







 def __init__(self ,   A=0       )    ->     Dict:  # a graph with Node 0,1,...,N-1


      """simple docstring"""



      _a      =  n
      _a      =  [
          [math.inf for j in range(0 ,   A       )] for i in range(0 ,   A       )
      ]  # adjacency matrix for weight
      _a      =  [
          [math.inf for j in range(0 ,   A       )] for i in range(0 ,   A       )
      ]  # dp[i][j] stores minimum distance from i to j



 def 					a__  (self ,   A ,   A ,   A       )    ->     Tuple:


      """simple docstring"""



      _a      =  w



 def 					a__  (self       )    ->     List[Any]:


      """simple docstring"""



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



 def 					a__  (self ,   A ,   A       )    ->     str:


      """simple docstring"""



      return self.dp[u][v]


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



