In a group of kids, one of them is selected to be the seeker. All the other kids hide in different places and the seeker's task is to spot them without getting touched by any of the hiding players. Recently Chopper was playing this with his friends and guess what, it's time to hide! General strategy of this game is to hide in different places far apart, so that the seeker doesn't spot everyone at once. But staying too far can result in a never ending game, which everyone hates.

The playground can be specified as a tree structure with $n$ possible hiding locations connected with $n-1$ roads of different lengths. Let $H$ be the set of locations which hiders choose. The efficiency of this selection is defined by the function $f(H)$ which can be calculated as follows:

$f(H)$ = the maximum length between any two locations $u$ and $v$ such that they both belong to the shortest path between any atleast one pair of nodes in $H$.

That was a lot to take in for our little friend Chopper. That's why he needs you to know the value of $f(H)$ for several selections.

Input

Input starts with two integers $n, m$ denoting the number of nodes in the tree and the number of selections made by Chopper. The follwoing $n - 1$ lines each giving three integers $u, v, w$ denoting an edge connecting $u$ and $v$ with length $w$.

The next $m$ lines will each describe a selection. Each line begins with the size of the selection $|H_i|$, followed by the sequence of nodes which the hiders have chosen.