Your country has N cities and N−1 roads connecting pairs of cities in such a way that there is a path between any pair of cities. For each road, you are given its toll that is the amount of money one has to pay in order to traverse it. The cost of traveling from city A to city B is the sum of the tolls of the roads in the path from A to B.
You are given Q queries to process. There are two types of queries:
Since the answers can be very large, print them modulo 1,000,000,007.
In the first query, distance is 4+3+2+5=14
In the first query, distance is 4+6+4+5=19