A country consists of n cities connected by (n−1) multidimensional roads, where each road has length li meters. A group of friends want to purchase a jewelry piece.
There are m jewelry pieces in the country and each of them is located in some city ci and has a value vi. Each friend cannot walk for more than wi meters.
Your task is to determine the highest value of the jewelry piece that you can buy if a friend started walking from city 1 and returns to the same city after the purchase.
Input format
Output format
Print k integers, where the ith value represents the highest value of jewelry piece that they bought. The ith friend can buy the jewelry piece if he or she started walking from city 1 and returned to the same city after the purchase.
Constraints
1≤n≤10001≤m≤1061≤k≤1061≤wi≤10001≤li≤10001≤vj≤109