BerlCo, a newly established company, is planning to set up offices in various cities across Berlandia. There are exactly cities in Berlandia, and the government has constructed roads so that there is exactly one simple path between each pair of cities. After research, the company's management has identified optimal combinations of cities for establishing offices, based on factors such as population, demand, age of residents, and other criteria (known only to management). Your task is to determine, for each combination, in which city the main office (where the management will be located) should be set up. The office should be placed so that the distance to the farthest office in the combination is minimized.
The first line contains a natural number (1 \leq N \leq 10^5) — the number of cities in Berlandia.
The next N - 1 lines provide information about the roads. Each of these lines contains three natural numbers u_i, v_i, w_i (1 \leq u_i, v_i \leq N, 1 \leq w_i \leq 100) — two cities connected by a road and the distance between them.
The (N + 1)-th line contains the number (1 \leq K \leq 10^5) — the number of office selection options.
In the next lines, each option is described by a number p_i and then p_i city numbers — the cities where offices are planned to be established. The total number of cities in all options will not exceed 10^5. It is guaranteed that \sum p_i \leq 10^5.
For each option, output a single line: first, the number of cities that meet the required criteria, followed by the numbers of these cities in ascending order. It is guaranteed that the total number of suitable cities will not exceed 3 \cdot 10^5.
Example 1