Going to movie
Chip'n'Dale are helping everyone on the country iLandia. One upon time after successful ending of their missions they decided to go to the cinema. But the trouble. There is only one cinema in ILandia, which is situated in capital. Chip eds his adventure in city and Dale in city . There is a lack of time till the begin of film session, that is why both of them have decided to order a taxi. Unfortunately our heroes doesn't earn a lot of money from their work. Both of them want to spend as small as possible. Chip can share the cab with Dale and Dale can do the same, but they need to be in one city. In order to that all taxi drivers in iLandia have the same fixed rate for one km. That means that they will split cost for the way which they spend together. You have few scenario of ending adventure of Chip'n'Dale in a different cities. You need to calculate minimum sum of money which they need to get to cinema (for each scenatio).
There is only one road between two city. The distance between two neighboring cities is km. The capital always have number .
Input
The first line contains two positive integers: the number of cities in iLindia and the rate in cab per km. In the next lines two positive integers and are given, they describe the road between city and city . All roads are two-way. The next line contains the number of scenarios . Each scenario starts with city numbers and where Chip'n'Dale will finish their adventures.
Output
Print two numbers — the amount of money spent by Chip and Dale, with precision no less than .