


"""simple docstring"""





from __future__ import annotations


def      _snake_case						(						_snake_case				:			list[float] ,   _snake_case				:			List[str]			)     ->   Tuple:
      print(f'''Vertex\tShortest Distance from vertex {src}'''			)
      for i, d in enumerate(_snake_case			):
            print(f'''{i}\t\t{d}'''			)


def      _snake_case						(						_snake_case				:			list[dict[str, int]] ,   _snake_case				:			list[float] ,   _snake_case				:			int			)     ->   int:
      for j in range(_snake_case			):
            lowerCAmelCase					:	Optional[int]       =   (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      _snake_case						(						_snake_case				:			list[dict[str, int]] ,   _snake_case				:			int ,   _snake_case				:			int ,   _snake_case				:			int			)     ->   str:
      lowerCAmelCase					:	Optional[int]       =   [float('''inf'''			)] * vertex_count
      lowerCAmelCase					:	Tuple       =   0.0

      for _ in range(vertex_count - 1			):
            for j in range(_snake_case			):
                  lowerCAmelCase					:	int       =   (graph[j][k] for k in ['''src''', '''dst''', '''weight'''])

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

      lowerCAmelCase					:	Optional[Any]       =   check_negative_cycle(_snake_case ,   _snake_case ,   _snake_case			)
      if negative_cycle_exists:
            raise Exception('''Negative cycle found'''			)

      return distance


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 snake_case__		:     Dict    				=				int(input('''Enter number of vertices: ''').strip())
 snake_case__		:     Any    				=				int(input('''Enter number of edges: ''').strip())

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

 for i in range(E):
  print('''Edge ''', i + 1)
  snake_case__		:     Union[str, Any]    				=				(
      int(x)
      for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
  )
  snake_case__		:     Dict    				=				{'''src''': src, '''dst''': dest, '''weight''': weight}

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






"""simple docstring"""





def      _snake_case						(						_snake_case				:			int = 4000000			):
      lowerCAmelCase					:	int       =   [0, 1]
      lowerCAmelCase					:	List[str]       =   0
      while fib[i] <= n:
            fib.append(fib[i] + fib[i + 1]			)
            if fib[i + 2] > n:
                  break
            i += 1
      lowerCAmelCase					:	int       =   0
      for j in range(len(_snake_case			) - 1			):
            if fib[j] % 2 == 0:
                  total += fib[j]

      return total


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


