Problem 6



Mr. Tonmoy is a service holder of BUET ( British Ultramodern Energy Technique ) Company. He liked his boss very much. But, recently, he hates him  as he (The Boss) ordered him to go to Bangladesh. Tonmoy knows  that Bangladesh is a country of Traffic Jam and no Government has yet taken this serious problem into account. All the people of that country matched themselves with this annoying Jam. At first, Tonmoy wanted to avoid the order but the boss insisted him visiting Bangladesh. Well, as there is no way to escape, Tonmoy is planning to take the Laptop and a map of  roads of Bangladesh with him. Now your task is to help Tonmoy  by writing a good program that will take different roadmaps of Bangladesh and help him to determine the shortest road having shortest time ( first considering shortest time then shortest road among the determined paths ) to go from one place to another so that he can avoid that terrible jam.


Input consists of several input blocks. The first line in the input file consists of the number of cases to solve. Next lines will consist of several roadmaps. The first line of a block consists two integers x & y indicating the number of distinct places and the number of roads exists between them. Places are numbered starting from 1. The next y lines consists of four integers a, b, c, d indicating two ends of a road, time and road length respectively. Next line contains  number of queries q for that particular map. Next q lines contains two integers, source and destination. You are to compute shortest distance having shortest time from the source to destination for each query. None of the roads of Bangladesh are one ways. Consecutive blocks are separated by a blank line. There are at most 25 roads in a road map.


For each query your correct program should output one of the two cases , in a separate line.

1) No Path.
2) Distance and time to reach destination is m & n.

where m and n indicate distance and time to reach from source to destination respectively using the above process. Consecutive blocks of outputs should be separated by a blank line. For clarification check the following sample inputs and corresponding outputs.

Sample Input


3 2
1 2 2 5
2 3 3 6
1 3
1 3

4 2
1 2 5 2
2 3 6 3
1 4

Sample Output

Distance and time to reach destination is 11 & 5.
Distance and time to reach destination is 11 & 5.

No Path.

Anupam & Shabuj ( BUET PESSIMISTIC )