

"""simple docstring"""






from queue import PriorityQueue
from typing import Any

import numpy as np



def   lowercase_	(    _lowercase       :		Optional[int]							,      _lowercase       :		List[str]							,      _lowercase       :		Union[str, Any]							,      _lowercase       :		Any							,      _lowercase       :		List[str]							,      _lowercase       :		Any							,      _lowercase       :		List[str]							,      _lowercase       :		Optional[Any]							,      _lowercase       :		int							,      ):




					'''simple docstring'''






					for nxt, d in graph[v]:
										if nxt in visited_forward:
															continue
										UpperCAmelCase			:   str      =				cst_fwd.get(__snake_case							,      np.inf	)
										UpperCAmelCase			:   Tuple      =				cst_fwd[v] + d
										if new_cost_f < old_cost_f:
															queue.put((new_cost_f, nxt)	)
															UpperCAmelCase			:   Tuple      =				new_cost_f
															UpperCAmelCase			:   int      =				v
										if nxt in visited_backward:
															if cst_fwd[v] + d + cst_bwd[nxt] < shortest_distance:
																				UpperCAmelCase			:   Any      =				cst_fwd[v] + d + cst_bwd[nxt]
					return shortest_distance



def   lowercase_	(    _lowercase       :		Dict							,      _lowercase       :		Dict							,      _lowercase       :		Optional[int]							,      _lowercase       :		Tuple	):




					'''simple docstring'''






					UpperCAmelCase			:   Dict      =				-1

					UpperCAmelCase			:   List[Any]      =				set()
					UpperCAmelCase			:   int      =				set()
					UpperCAmelCase			:   Dict      =				{source: 0}
					UpperCAmelCase			:   str      =				{destination: 0}
					UpperCAmelCase			:   Tuple      =				{source: None}
					UpperCAmelCase			:   Dict      =				{destination: None}
					UpperCAmelCase			:   str      =				PriorityQueue()
					UpperCAmelCase			:   Dict      =				PriorityQueue()

					UpperCAmelCase			:   Tuple      =				np.inf

					queue_forward.put((0, source)	)
					queue_backward.put((0, destination)	)

					if source == destination:
										return 0

					while not queue_forward.empty() and not queue_backward.empty():
										UpperCAmelCase      ,							UpperCAmelCase			:   int      =				queue_forward.get()
										visited_forward.add(__snake_case	)

										UpperCAmelCase      ,							UpperCAmelCase			:   Any      =				queue_backward.get()
										visited_backward.add(__snake_case	)

										UpperCAmelCase			:   Optional[int]      =				pass_and_relaxation(
										    __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      )

										UpperCAmelCase			:   Tuple      =				pass_and_relaxation(
										    __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      __snake_case							,      )

										if cst_fwd[v_fwd] + cst_bwd[v_bwd] >= shortest_distance:
															break

					if shortest_distance != np.inf:
										UpperCAmelCase			:   Any      =				shortest_distance
					return shortest_path_distance


snake_case_        =       {
    """B""": [["""C""", 1]],
    """C""": [["""D""", 1]],
    """D""": [["""F""", 1]],
    """E""": [["""B""", 1], ["""G""", 2]],
    """F""": [],
    """G""": [["""F""", 1]],
}
snake_case_        =       {
    """B""": [["""E""", 1]],
    """C""": [["""B""", 1]],
    """D""": [["""C""", 1]],
    """F""": [["""D""", 1], ["""G""", 1]],
    """E""": [[None, np.inf]],
    """G""": [["""E""", 2]],
}

if __name__ == "__main__":
	import doctest

	doctest.testmod()





"""simple docstring"""






import os



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   Union[str, Any]      =				os.path.join(os.path.dirname(_lowercase	)							,      "num.txt"	)
					with open(_lowercase	) as file_hand:
										return str(sum(int(_lowercase	) for line in file_hand	)	)[:10]


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


