Edward is a truck driver of a big company. His daily work is driving a truck from one city to another. Recently he got a long distance driving work, so he may be needed to add fuel to his truck on the way. His boss gives him a fuel card, he can use the card anytime at any fuel station and add any amount of fuel. He does not spend any money when he uses the card. He noticed that there are some cities where he could sell fuel. The greedy driver Edward want to make some money while he doing this work. And this is his plan:

There are `N` cities on his map and numbered from 1 to `N`, he need to drive from city 1 to city `N` to finish this task. Driving from one city to another need fuel cost too. There are some of the cities has fuel station, he could use his fuel card at these cities. Notice his truck has a fuel tank capacity `C` and it could not exceed the capacity when add fuel. **At the beginning, he is at city 1 and he has a full tank.**

At some cities he could sell any amount of fuel he has, and the prices at each city maybe different. Since he does not want to be found, he sell the fuel at most once totally. Under the premise of driving to city `N` finally, he wants to make the maximal money.

There are multiple test cases. For each test case:

The first line contains three integer `N` (1 ≤ `N` ≤ 1000), `M` (1 ≤ `M` ≤ 100000), `C`(1 ≤ `C` ≤ 30000), `N` is the number of cities, `M` is the number of roads, please notice that the roads is single-way, and `C` is the fuel tank capacity.

The after `M` lines describe the roads, each line has three integers `A`, `B` (1 ≤ `A`, `B` ≤ `N`), `L` (1 ≤ `L` ≤ 30000). That means the fuel cost from city `A` to city `B` is `L`.

Then a single line contain one integer `P` (0 ≤ `P` ≤ `N`), it is the number of cities which has a fuel station.

The after single line contains `P` integers, each integer `p _{i}` (1 ≤

Then a single line contain one integer `Q` (0 ≤ `Q` ≤ `N`), it is the number of cities which he could sell fuel.

Each of the after `Q` lines contains two integers `q _{i}` (1 ≤

There is a blank line between every two cases.

Process to the end of input.

提交代码