"""simple docstring"""







from __future__ import annotations




def   __UpperCAmelCase    (   UpperCAmelCase_   :    Union[str, Any]      ,							UpperCAmelCase_   :    Dict  )							->      Optional[Any]:

	'''simple docstring'''





	print(F"Vertex\tShortest Distance from vertex {src}"  )
	for i, d in enumerate(__lowerCAmelCase  ):
		print(F"{i}\t\t{d}"  )




def   __UpperCAmelCase    (   UpperCAmelCase_   :    Any      ,							UpperCAmelCase_   :    Tuple      ,							UpperCAmelCase_   :    str  )							->      Dict:

	'''simple docstring'''





	for j in range(__lowerCAmelCase  ):
		__snake_case      :							Optional[Any]						=			(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   __UpperCAmelCase    (   UpperCAmelCase_   :    Tuple      ,							UpperCAmelCase_   :    List[str]      ,							UpperCAmelCase_   :    List[str]      ,							UpperCAmelCase_   :    Optional[int]  )							->      list[float]:

	'''simple docstring'''





	__snake_case      :							List[Any]						=			[float('inf'  )] * vertex_count
	__snake_case      :							int						=			0.0

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

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

	__snake_case      :							Union[str, Any]						=			check_negative_cycle(__lowerCAmelCase      ,							__lowerCAmelCase      ,							__lowerCAmelCase  )
	if negative_cycle_exists:
		raise Exception('Negative cycle found'  )

	return distance


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	_a					:					Union[str, Any]=			int(input("Enter number of vertices: ").strip())
	_a					:					Optional[Any]=			int(input("Enter number of edges: ").strip())

	_a					:					Dict=			[{} for _ in range(E)]

	for i in range(E):
		print("Edge ", i + 1)
		_a,		_a,		_a					:					Dict=			(
		    int(x)
		    for x in input("Enter source, destination, weight: ").strip().split(" ")
		)
		_a					:					Dict=			{"src": src, "dst": dest, "weight": weight}

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






"""simple docstring"""







from __future__ import annotations

import math
def   __UpperCAmelCase    (   UpperCAmelCase_   :    int  )							->      bool:

	'''simple docstring'''





	if 1 < number < 4:
		# 2 and 3 are primes
		return True
	elif number < 2 or number % 2 == 0 or number % 3 == 0:
		# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
		return False

	# All primes number are in format of 6k +/- 1
	for i in range(5      ,							int(math.sqrt(UpperCAmelCase_  ) + 1  )      ,							6  ):
		if number % i == 0 or number % (i + 2) == 0:
			return False
	return True


_a					:					Any=			[num for num in range(3, 100_001, 2) if not is_prime(num)]
def   __UpperCAmelCase    (   UpperCAmelCase_   :    int  )							->      list[int]:

	'''simple docstring'''





	if not isinstance(UpperCAmelCase_      ,							UpperCAmelCase_  ):
		raise ValueError('n must be an integer'  )
	if n <= 0:
		raise ValueError('n must be >= 0'  )

	__snake_case      :							int						=			[]
	for num in range(len(UpperCAmelCase_  )  ):
		__snake_case      :							List[str]						=			0
		while 2 * i * i <= odd_composites[num]:
			__snake_case      :							List[Any]						=			odd_composites[num] - 2 * i * i
			if is_prime(UpperCAmelCase_  ):
				break
			i += 1
		else:
			list_nums.append(odd_composites[num]  )
			if len(UpperCAmelCase_  ) == n:
				return list_nums

	return []
def   __UpperCAmelCase    (   )							->      int:

	'''simple docstring'''





	return compute_nums(1  )[0]


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





