





from __future__ import annotations







def  _SCREAMING_SNAKE_CASE				(   a					,						a  )      ->      List[str]:
					print(F"""Vertex\tShortest Distance from vertex {src}"""  )
					for i, d in enumerate(a  ):
										print(F"""{i}\t\t{d}"""  )







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a  )      ->      Union[str, Any]:






					for j in range(a  ):
										__A    ,				__A    ,				__A	:						Tuple       =				(graph[j][k] for k in ['src', 'dst', 'weight'])
										if distance[u] != float('inf'  ) and distance[u] + w < distance[v]:
															return True
					return False







def  _SCREAMING_SNAKE_CASE				(   a					,						a					,						a					,						a  )      ->      list[float]:
					__A	:						Any       =				[float('inf'  )] * vertex_count
					__A	:						str       =				0.0

					for _ in range(vertex_count - 1  ):
										for j in range(a  ):
															__A    ,				__A    ,				__A	:						List[Any]       =				(graph[j][k] for k in ['src', 'dst', 'weight'])

															if distance[u] != float('inf'  ) and distance[u] + w < distance[v]:
																				__A	:						Optional[int]       =				distance[u] + w

					__A	:						str       =				check_negative_cycle(a					,						a					,						a  )
					if negative_cycle_exists:
										raise Exception('Negative cycle found'  )

					return distance


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				UpperCAmelCase						:   Dict			  =     int(input('''Enter number of vertices: ''').strip())
				UpperCAmelCase						:   Optional[int]			  =     int(input('''Enter number of edges: ''').strip())

				UpperCAmelCase						:   list[dict[str, int]]			  =     [{} for _ in range(E)]

				for i in range(E):
								print('''Edge ''', i + 1)
								UpperCAmelCase						:   Dict			  =     (
								    int(x)
								    for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
								)
								UpperCAmelCase						:   List[Any]			  =     {'src': src, 'dst': dest, 'weight': weight}

				UpperCAmelCase						:   Union[str, Any]			  =     int(input('''\nEnter shortest path source:''').strip())
				UpperCAmelCase						:   List[Any]			  =     bellman_ford(graph, V, E, source)
				print_distance(shortest_distance, 0)











from itertools import permutations



def _a				(	lowerCamelCase:   tuple )	->						bool:







      '''simple docstring'''






      if num[3] % 2 != 0:
            return False

      if (num[2] + num[3] + num[4]) % 3 != 0:
            return False

      if num[5] % 5 != 0:
            return False

      __A          =				[7, 11, 13, 17]
      for i, test in enumerate(lowerCamelCase ):
            if (num[i + 4] * 1_00 + num[i + 5] * 10 + num[i + 6]) % test != 0:
                  return False
      return True



def _a				(	lowerCamelCase:   int = 10 )	->						int:







      '''simple docstring'''






      return sum(
          int(''''''.join(map(lowerCamelCase					,				lowerCamelCase ) ) )
          for num in permutations(range(lowerCamelCase ) )
          if is_substring_divisible(lowerCamelCase ) )


if __name__ == "__main__":
       print(f'{solution() = }')





