eolymp
bolt
Try our new interface for solving problems
Problems

The roads in ByteLandia

The roads in ByteLandia

Time limit 0.5 seconds
Memory limit 64 MiB

The ByteLandia is a country situated on islands. There was the presidential election. Bityk won the election. He decided to visit the islands on his new RoverLand. For that he need to build the bridges between some of the islands. Due to the fact that the budget in the country is limited, the bridges must be build in one way. After Bityk visited some of the islands, he return to capital by helicopter with his car (the budget for the flying is not limited, but he need to ride on roads which was just built – this is a duty of the president). That mean that the route if presitent must consist from 2 parts:

  1. On his RoverLand he is getting in some islands

  2. From island to the capital he is returning on helicopter

For each kilometer of bridge needs to pay 1 ByteLandia tugrik. The architect gave president the list of bridges, which theoretically could be build, without harming the nature of islands.

Help Bityk to calculate which minimum budget he need to allocate. The bridge need to be build is such way that it would be possible to get from the capital to any other island.

Input data

In the first line will be input two positive numbers N (1N10^4) – number of islands, and M (1M10^5) – number of projects for bridges. In next M lines will be 3 positive integers: u (1uN), v (1vN), w (1w10^5), where u, v – numbers of islands, which will be connected by certain bridge, and w – length of bridge. Between two islands can be several numbers of bridges with different length. In the last line only one positive integer X (1XN) – number of capital.

Output data

If it will be exist island, which will be not reachable by Bityk, simply output "Helicopter" (without quotes), else output the budget of all new constructions.

Examples

Input example #1
5 5
1 2 4
1 5 5
2 3 3
3 4 2
4 2 1
1
Output example #1
14
Author Ostap Stoliarchuk
Source Distance Summer Computer School - Summer 2013