This is not as easy as it seems. It often takes a knight several days to go
from the castle where he lives to the place where a tournament is held.
But horses sometimes are very, very stubborn. After having covered a certain distance
on a single day, they sometimes simply stop and refuse to go any further.
Luckily, they start anew on the next day. To make sure that the horse does not
refuse service before the scheduled day trip is completed, a knight wants to choose an
itinerary on which the longest day trip is as short as possible. 
Hence, a trip that takes many days with short distances is preferable over a
shorter route that has the risk of a refusing horse.
Write a program which answers queries from knights spread all over the country about the best way to go from their castles to a tournament site. Given a description of the relevant places (i.e. castles, locations of tournaments, and hostels for overnight stays), the program should tell them the largest distance they have to cover on a single day so that this distance is minimal among all possible itineraries.
The places are designated by consecutive integers from 1 to  , while a road
is represented by three integers, namely its place of origin, its destination,
and its length. Every road can be used in both directions, and there is at
least one route (i.e. a sequence of roads) between any two places. The knights stick
to the given roads while travelling and spend their nights only at one of the
, while a road
is represented by three integers, namely its place of origin, its destination,
and its length. Every road can be used in both directions, and there is at
least one route (i.e. a sequence of roads) between any two places. The knights stick
to the given roads while travelling and spend their nights only at one of the
 places.
 places.
	
	Input 
The first line contains the total number of test cases that follow.
Each test case begins with a line that first holds the number  of places
(
 of places
(
 ) followed by the number
) followed by the number  of roads (
 of roads (
 ). Then there are
). Then there are  lines with three integers each (
 lines with three integers each ( ,
,  , and
, and
 ), each of which defines a road connecting the places
), each of which defines a road connecting the places  and
 and  (
 (
 )
with length
)
with length  (
 (
 ).
).
Thereafter, each test case continues with the number  of queries on a line by
itself (
 of queries on a line by
itself (
 ). Each of the next
). Each of the next  lines holds two integers
 lines holds two integers
 and
 and  , indicating a query by a knight who lives at place
, indicating a query by a knight who lives at place  and
needs to go to a tournament at place
 and
needs to go to a tournament at place  (
 (
 ,
,  ).
).
	Output 
For each test case output a line containing the word ``Case'', a single
space, and its serial number (starting with  for the first test case). Then,
print one line for each query in this test case, containing the smallest maximal day trip
distance as described above.
Print a blank line after each test case.
 for the first test case). Then,
print one line for each query in this test case, containing the smallest maximal day trip
distance as described above.
Print a blank line after each test case.
Sample Input
Sample Output