





"""simple docstring"""
def   __lowerCamelCase     (							a_  :	List[Any]				,     a_  :	List[str]							)    ->   Optional[Any]:
      print('''\nVertex Distance'''							)
      for i in range(_A							):
            if dist[i] != float('''inf'''							):
                  print(_A				,     '''\t'''				,     int(dist[i]							)				,     end='''\t'''							)
            else:
                  print(_A				,     '''\t'''				,     '''INF'''				,     end='''\t'''							)
            print()



def   __lowerCamelCase     (							a_  :	Any				,     a_  :	str				,     a_  :	Any							)    ->   Optional[Any]:
      __SCREAMING_SNAKE_CASE     :str	       =						float('''inf'''							)
      __SCREAMING_SNAKE_CASE     :Tuple	       =						-1
      for i in range(_A							):
            if (not vset[i]) and mdist[i] < min_val:
                  __SCREAMING_SNAKE_CASE     :Optional[int]	       =						i
                  __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						mdist[i]
      return min_ind



def   __lowerCamelCase     (							a_  :	Tuple				,     a_  :	List[Any]				,     a_  :	int							)    ->   str:
      __SCREAMING_SNAKE_CASE     :List[Any]	       =						[float('''inf'''							) for _ in range(_A							)]
      __SCREAMING_SNAKE_CASE     :Dict	       =						[False for _ in range(_A							)]
      __SCREAMING_SNAKE_CASE     :str	       =						0.0

      for _ in range(v - 1							):
            __SCREAMING_SNAKE_CASE     :List[Any]	       =						min_dist(_A				,     _A				,     _A							)
            __SCREAMING_SNAKE_CASE     :List[Any]	       =						True

            for i in range(_A							):
                  if (
                      (not vset[i])
                      and graph[u][i] != float('''inf'''							)
                      and mdist[u] + graph[u][i] < mdist[i]
                  ):
                        __SCREAMING_SNAKE_CASE     :List[str]	       =						mdist[u] + graph[u][i]

      print_dist(_A				,     _A							)


if __name__ == "__main__":
  lowerCamelCase_          =	int(input("Enter number of vertices: ").strip())
  lowerCamelCase_          =	int(input("Enter number of edges: ").strip())

  lowerCamelCase_          =	[[float("inf") for i in range(V)] for j in range(V)]

  for i in range(V):
    lowerCamelCase_          =	0.0

  for i in range(E):
    print("\nEdge ", i + 1)
    lowerCamelCase_          =	int(input("Enter source:").strip())
    lowerCamelCase_          =	int(input("Enter destination:").strip())
    lowerCamelCase_          =	float(input("Enter weight:").strip())
    lowerCamelCase_          =	weight

  lowerCamelCase_          =	int(input("\nEnter shortest path source:").strip())
  dijkstra(graph, V, gsrc)










"""simple docstring"""
# Lint as: python3

import hashlib
from typing import Union



def   __lowerCamelCase     (							a_  :	Union[str, int, bytes]							)    ->   bytes:
      if isinstance(a_				,     a_							):
            # Data already in bytes, returns as it as
            return hash_data
      elif isinstance(a_				,     a_							):
            # We keep the data as it as for it ot be later encoded to UTF-8
            # However replace `\\` with `/` for Windows compatibility
            __SCREAMING_SNAKE_CASE     :str	       =						hash_data.replace('''\\'''				,     '''/'''							)
      elif isinstance(a_				,     a_							):
            __SCREAMING_SNAKE_CASE     :Union[str, Any]	       =						str(a_							)
      else:
            # If data is not of the required type, raise error
            raise InvalidKeyError(a_							)

      return hash_data.encode('''utf-8'''							)






class       _SCREAMING_SNAKE_CASE(     A						):




       def __init__(		self	,SCREAMING_SNAKE_CASE__							)    ->   Optional[int]:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE     :Tuple	       =						'''\nFAILURE TO GENERATE DATASET: Invalid key type detected'''
             __SCREAMING_SNAKE_CASE     :int	       =						f'''\nFound Key {hash_data} of type {type(SCREAMING_SNAKE_CASE__							)}'''
             __SCREAMING_SNAKE_CASE     :Optional[int]	       =						'''\nKeys should be either str, int or bytes type'''
             super().__init__(f'''{self.prefix}{self.err_msg}{self.suffix}'''							)






class       _SCREAMING_SNAKE_CASE(     A						):




       def __init__(		self	,SCREAMING_SNAKE_CASE__	,SCREAMING_SNAKE_CASE__	,SCREAMING_SNAKE_CASE__=""							)    ->   List[str]:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE     :str	       =						key
             __SCREAMING_SNAKE_CASE     :str	       =						duplicate_key_indices
             __SCREAMING_SNAKE_CASE     :Union[str, Any]	       =						fix_msg
             __SCREAMING_SNAKE_CASE     :int	       =						'''Found multiple examples generated with the same key'''
             if len(SCREAMING_SNAKE_CASE__							) <= 20:
                   __SCREAMING_SNAKE_CASE     :Dict	       =						f'''\nThe examples at index {", ".join(SCREAMING_SNAKE_CASE__							)} have the key {key}'''
             else:
                   __SCREAMING_SNAKE_CASE     :List[str]	       =						f'''\nThe examples at index {", ".join(duplicate_key_indices[:20]							)}... ({len(SCREAMING_SNAKE_CASE__							) - 20} more) have the key {key}'''
             __SCREAMING_SNAKE_CASE     :Union[str, Any]	       =						'''\n''' + fix_msg if fix_msg else ''''''
             super().__init__(f'''{self.prefix}{self.err_msg}{self.suffix}'''							)






class       _SCREAMING_SNAKE_CASE:




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





             """simple docstring"""






             __SCREAMING_SNAKE_CASE     :Dict	       =						hashlib.mda(_as_bytes(SCREAMING_SNAKE_CASE__							)							)




       def 					_UpperCamelCase  (		self	,SCREAMING_SNAKE_CASE__							)    ->   int:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE     :Tuple	       =						self._split_mda.copy()
             __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						_as_bytes(SCREAMING_SNAKE_CASE__							)
             mda.update(SCREAMING_SNAKE_CASE__							)
             # Convert to integer with hexadecimal conversion
             return int(mda.hexdigest()	,16							)