



from __future__ import annotations






def      _A				(UpperCamelCase		:      list[float]      ,			UpperCamelCase		:      List[str] )  ->Optional[Any]:



			'''simple docstring'''







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






def      _A				(UpperCamelCase		:      list[dict[str, int]]      ,			UpperCamelCase		:      list[float]      ,			UpperCamelCase		:      int )  ->Optional[Any]:



			'''simple docstring'''







			for j in range(UpperCamelCase ):
						lowerCamelCase__ :      Dict								=		(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      _A				(UpperCamelCase		:      list[dict[str, int]]      ,			UpperCamelCase		:      int      ,			UpperCamelCase		:      int      ,			UpperCamelCase		:      int )  ->list[float]:



			'''simple docstring'''







			lowerCamelCase__ :      int								=		[float("""inf""" )] * vertex_count
			lowerCamelCase__ :      Optional[int]								=		0.0

			for _ in range(vertex_count - 1 ):
						for j in range(UpperCamelCase ):
									lowerCamelCase__ :      Optional[int]								=		(graph[j][k] for k in ["""src""", """dst""", """weight"""])

									if distance[u] != float("""inf""" ) and distance[u] + w < distance[v]:
												lowerCamelCase__ :      str								=		distance[u] + w

			lowerCamelCase__ :      Optional[int]								=		check_negative_cycle(UpperCamelCase      ,			UpperCamelCase      ,			UpperCamelCase )
			if negative_cycle_exists:
						raise Exception("""Negative cycle found""" )

			return distance


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				_lowercase     							=						int(input('''Enter number of vertices: ''').strip())
				_lowercase     							=						int(input('''Enter number of edges: ''').strip())

				_lowercase     							=						[{} for _ in range(E)]

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

				_lowercase     							=						int(input('''\nEnter shortest path source:''').strip())
				_lowercase     							=						bellman_ford(graph, V, E, source)
				print_distance(shortest_distance, 0)






from string import ascii_uppercase

_lowercase     							=						{char: i for i, char in enumerate(ascii_uppercase)}
_lowercase     							=						dict(enumerate(ascii_uppercase))






def      _A				(UpperCamelCase		:      str      ,			UpperCamelCase		:      str )  ->str:



			'''simple docstring'''







			lowerCamelCase__ :      List[str]								=		len(UpperCamelCase )
			lowerCamelCase__ :      int								=		0
			while True:
						if x == i:
									lowerCamelCase__ :      Union[str, Any]								=		0
						if len(UpperCamelCase ) == len(UpperCamelCase ):
									break
						key += key[i]
						i += 1
			return key






def      _A				(UpperCamelCase		:      str      ,			UpperCamelCase		:      str )  ->str:



			'''simple docstring'''







			lowerCamelCase__ :      int								=		""""""
			lowerCamelCase__ :      str								=		0
			for letter in message:
						if letter == " ":
									cipher_text += " "
						else:
									lowerCamelCase__ :      Optional[int]								=		(dicta[letter] - dicta[key_new[i]]) % 26
									i += 1
									cipher_text += dicta[x]
			return cipher_text






def      _A				(UpperCamelCase		:      str      ,			UpperCamelCase		:      str )  ->str:



			'''simple docstring'''







			lowerCamelCase__ :      Dict								=		""""""
			lowerCamelCase__ :      Tuple								=		0
			for letter in cipher_text:
						if letter == " ":
									or_txt += " "
						else:
									lowerCamelCase__ :      List[Any]								=		(dicta[letter] + dicta[key_new[i]] + 26) % 26
									i += 1
									or_txt += dicta[x]
			return or_txt






def      _A				()  ->None:



			'''simple docstring'''







			lowerCamelCase__ :      Union[str, Any]								=		"""THE GERMAN ATTACK"""
			lowerCamelCase__ :      Union[str, Any]								=		"""SECRET"""
			lowerCamelCase__ :      List[str]								=		generate_key(UpperCamelCase      ,			UpperCamelCase )
			lowerCamelCase__ :      List[Any]								=		cipher_text(UpperCamelCase      ,			UpperCamelCase )
			print(f"Encrypted Text = {s}" )
			print(f"Original Text = {original_text(UpperCamelCase      ,			UpperCamelCase )}" )


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()



