SP9938 DISNEY - Disney Fastpass
Description

Input Format
The first line contains an integer **T** (1 ≤ **T** ≤ 25), indicating the number of test cases.
Each test case contains several lines. The first line contains three integers **N**, **M**, **K** (1 ≤ **N** ≤ 50, 0 ≤ **M** ≤ **N**(**N**-1)/2, 0 ≤ **K** ≤ 8), indicating the number of locations(starting with 1, and 1 is the only gate of the park where the trip must be started and ended), the number of roads and the number of interested attractions.
The following **M** lines each contains three integers **A**, **B**, **D** (1 ≤ **A**, **B** ≤ **N**, 0 ≤ **D** ≤ 10 $ ^{4} $ ) which means it takes **D** minutes to travel between location **A** and location **B**.
The following **K** lines each contains several integers **P** $ _{i} $ , **T** $ _{i} $ , **FT** $ _{i} $ , **N** $ _{i} $ , **F** $ _{i,1} $ , **F** $ _{i,2} $ ... **F** $ _{i,Ni} $ -1, **F** $ _{i,Ni} $ , (1 ≤ **P** $ _{i} $ , **N** $ _{i} $ , **F** $ _{i,j} $ ≤ **N**, 0 ≤ **FT** $ _{i} $ ≤ **T** $ _{i} $ ≤ 10 $ ^{4} $ ), which means the i-th interested attraction is placed at location **P** $ _{i} $ and there are **N** $ _{i} $ locations **F** $ _{i,1} $ , **F** $ _{i,2} $ ... **F** $ _{i,Ni} $ where you can get the FastPass for the _i_-th attraction. If you come to the _i_-th attraction with its FastPass, you need to wait for only **FT** $ _{i} $ minutes, otherwise you need to wait for **T** $ _{i} $ minutes.
You can assume that all the locations are connected and there is at most one road between any two locations. Note that there might be several attractions at one location.
Output Format
For each test case in the input, print one line: "Case #X: Y", where **X** is the test case number (starting with 1) and **Y** is the minimum time of the trip.