

class 						__UpperCamelCase    :




	def __init__(		self	:						int		,	lowerCAmelCase	:						Dict							):


		'''simple docstring'''







		UpperCAmelCase_       				=			arr.split(","							)




	def       __A					(		self	:						Tuple							):


		'''simple docstring'''







		UpperCAmelCase_       				=			[int(self.array[0]							)] * len(self.array							)
		UpperCAmelCase_       				=			[int(self.array[0]							)] * len(self.array							)
		for i in range(1		,	len(self.array							)							):
			UpperCAmelCase_       				=			max(
			    int(self.array[i]							) + sum_value[i - 1]		,	int(self.array[i]							)							)
			UpperCAmelCase_       				=			max(sum_value[i]		,	rear[i - 1]							)
		return rear[len(self.array							) - 1]


if __name__ == "__main__":
				_a:    Union[str, Any] 							=			input("""please input some numbers:""")
				_a:    List[str] 							=			SubArray(whole_array)
				_a:    Optional[int] 							=			array.solve_sub_array()
				print(("""the results is:""", re))


from __future__ import annotations



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



def       __lowerCAmelCase      (						A       ,     A       ,     A    ):
	for j in range(A    ):
		UpperCAmelCase_				,   UpperCAmelCase_				,   UpperCAmelCase_       				=			(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       __lowerCAmelCase      (						A       ,     A       ,     A       ,     A    ):
	UpperCAmelCase_       				=			[float("inf"    )] * vertex_count
	UpperCAmelCase_       				=			0.0

	for _ in range(vertex_count - 1    ):
		for j in range(A    ):
			UpperCAmelCase_				,   UpperCAmelCase_				,   UpperCAmelCase_       				=			(graph[j][k] for k in ["src", "dst", "weight"])

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

	UpperCAmelCase_       				=			check_negative_cycle(A       ,     A       ,     A    )
	if negative_cycle_exists:
		raise Exception("Negative cycle found"    )

	return distance


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				_a:    List[str] 							=			int(input("""Enter number of vertices: """).strip())
				_a:    str 							=			int(input("""Enter number of edges: """).strip())

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

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

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