Office
BerlCo, a newly established company, is planning to set up offices in various cities across Berlandia. There are exactly (N) cities in Berlandia, and the government has wisely constructed roads such that there is exactly one road connecting each pair of cities. After thorough research, the company's management has identified (K) optimal combinations of cities for establishing offices, based on factors like population, demand, and demographics, among others (details known only to the management). Your task is to determine the best city for the main office in each combination, ensuring that the distance to the farthest office is minimized.
Input
The first line of the input contains a natural number (N) ((1 N 10^5)), representing the number of cities in Berlandia.
The following (N-1) lines provide details about the roads. Each line contains three natural numbers (u_i), (v_i), (w_i) ((1 u_i, v_i N), (1 w_i 100)), indicating a pair of cities connected by a road and the distance between them. The (N+1) line contains the number (K) ((1 K 10^5)), representing the number of office selection options.
In the next (K) lines, each option is described by a number (p_i) followed by (p_i) city numbers, indicating where offices are planned to be established. The total number of cities across all options will not exceed (10^5). It is guaranteed that the sum of all (p_i 10^5).
Output
For each option, output a line containing the number of cities that meet the specified criteria, followed by the city numbers in ascending order. It is guaranteed that the total number of suitable cities will not exceed (3 10^5).