Country H has $n$ cities connected by $n-1$ bidirectional roads, forming a tree. City $1$ is the capital and the root of the tree.
A highly contagious disease has broken out in the capital. To control the epidemic and prevent it from spreading to the border cities (represented by the leaf nodes), the authorities have decided to deploy troops to establish checkpoints in some cities. This must be done such that every path from the capital to a border city contains at least one checkpoint. Checkpoints can also be established in border cities. However, it is strictly forbidden to establish a checkpoint in the capital.
Currently, troops are already stationed in some cities of Country H, and multiple troops can be stationed in a single city. A troop can move between cities connected by roads and establish a checkpoint in any city except the capital. Each troop can only establish one checkpoint. The time required for a troop to move along a road from one city to another is equal to the length of the road (in hours).
Find the minimum time required to control the epidemic. Note that different troops can move simultaneously.
Input
The first line contains an integer $n$, representing the number of cities.
The next $n-1$ lines each contain three integers $u$, $v$, and $w$, separated by spaces, indicating a road of length $w$ between city $u$ and city $v$. It is guaranteed that the input forms a tree and the root node is $1$.
The next line contains an integer $m$, representing the number of troops.
The next line contains $m$ integers, separated by spaces, representing the city IDs where the $m$ troops are currently stationed.
Output
Output a single integer representing the minimum time required to control the epidemic. If it is impossible to control the epidemic, output $-1$.
Examples
Input 1
4
1 2 1
1 3 2
3 4 3
2
2 2
Output 1
3
Note 1
The first troop establishes a checkpoint at city $2$, and the second troop moves from city $2$ to city $3$ to establish a checkpoint. The total time required is $3$ hours.
Constraints
It is guaranteed that no troops are stationed in the capital.
For $20\%$ of the data, $2 \le n \le 10$;
For $40\%$ of the data, $2 \le n \le 50$, $0 < w < 10^5$;
For $60\%$ of the data, $2 \le n \le 1000$, $0 < w < 10^6$;
For $80\%$ of the data, $2 \le n \le 10{,}000$;
For $100\%$ of the data, $2 \le m \le n \le 50{,}000$, $0 < w < 10^9$.