



from __future__ import annotations

from collections import Counter




def    UpperCAmelCase					(  lowercase__						:					int	):



			'''simple docstring'''





			a__					=  [True] * n
			a__					=  False
			a__					=  False
			a__					=  True

			for i in range(3				,					int(n**0.5 + 1	)				,					2	):
						a__					=  i * 2
						while index < n:
									a__					=  False
									a__					=  index + i

			a__					=  [2]

			for i in range(3				,					lowercase__				,					2	):
						if is_prime[i]:
									primes.append(lowercase__	)

			return primes




def    UpperCAmelCase					(  lowercase__						:					int	):



			'''simple docstring'''





			a__					=  str(lowercase__	)
			a__					=  []
			a__					=  ["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

			for duplicate in Counter(lowercase__	) - Counter(set(lowercase__	)	):
						a__					=  [int(number_str.replace(lowercase__				,					lowercase__	)	) for digit in digits]
						replacements.append(lowercase__	)

			return replacements




def    UpperCAmelCase					(  lowercase__						:					int = 8	):



			'''simple docstring'''





			a__					=  set()

			# Filter primes with less than 3 replaceable digits
			a__					=  {
			    x for x in set(prime_sieve(1000000	)	) if len(str(lowercase__	)	) - len(set(str(lowercase__	)	)	) >= 3
			}

			for prime in primes:
						if prime in numbers_checked:
									continue

						a__					=  digit_replacements(lowercase__	)

						for family in replacements:
									numbers_checked.update(lowercase__	)
									a__					=  primes.intersection(lowercase__	)

									if len(lowercase__	) != family_length:
												continue

									return min(lowercase__	)

			return -1


if __name__ == "__main__":
	print(solution())






def    UpperCAmelCase					(  lowercase__						:					List[Any]				,					lowercase__						:					Optional[int]	):



			'''simple docstring'''





			print("""\nVertex Distance"""	)
			for i in range(lowercase__	):
						if dist[i] != float("""inf"""	):
									print(lowercase__				,					"""\t"""				,					int(dist[i]	)				,					end="""\t"""	)
						else:
									print(lowercase__				,					"""\t"""				,					"""INF"""				,					end="""\t"""	)
						print()




def    UpperCAmelCase					(  lowercase__						:					Optional[int]				,					lowercase__						:					Any				,					lowercase__						:					Tuple	):



			'''simple docstring'''





			a__					=  float("""inf"""	)
			a__					=  -1
			for i in range(lowercase__	):
						if (not vset[i]) and mdist[i] < min_val:
									a__					=  i
									a__					=  mdist[i]
			return min_ind




def    UpperCAmelCase					(  lowercase__						:					Optional[Any]				,					lowercase__						:					Tuple				,					lowercase__						:					List[Any]	):



			'''simple docstring'''





			a__					=  [float("""inf"""	) for _ in range(lowercase__	)]
			a__					=  [False for _ in range(lowercase__	)]
			a__					=  0.0

			for _ in range(v - 1	):
						a__					=  min_dist(lowercase__				,					lowercase__				,					lowercase__	)
						a__					=  True

						for i in range(lowercase__	):
									if (
									    (not vset[i])
									    and graph[u][i] != float("""inf"""	)
									    and mdist[u] + graph[u][i] < mdist[i]
									):
												a__					=  mdist[u] + graph[u][i]

			print_dist(lowercase__				,					lowercase__	)


if __name__ == "__main__":
	_lowercase				:					Any     					=int(input("""Enter number of vertices: """).strip())
	_lowercase				:					List[str]     					=int(input("""Enter number of edges: """).strip())

	_lowercase				:					List[str]     					=[[float("""inf""") for i in range(V)] for j in range(V)]

	for i in range(V):
		_lowercase				:					Dict     					=0.0

	for i in range(E):
		print("""\nEdge """, i + 1)
		_lowercase				:					Dict     					=int(input("""Enter source:""").strip())
		_lowercase				:					Optional[Any]     					=int(input("""Enter destination:""").strip())
		_lowercase				:					List[Any]     					=float(input("""Enter weight:""").strip())
		_lowercase				:					List[str]     					=weight

	_lowercase				:					List[Any]     					=int(input("""\nEnter shortest path source:""").strip())
	dijkstra(graph, V, gsrc)

