Meanwhile, the kingdom of K is getting ready for the marriage of the King's daughter. However, in order not to lose face in front of the relatives, the King should first finish reforms in his kingdom. As the King can not wait for his daughter's marriage, reforms must be finished as soon as possible.

The kingdom currently consists of n cities. Cities are connected by n - 1 bidirectional road, such that one can get from any city to any other city. As the King had to save a lot, there is only one path between any two cities.

What is the point of the reform? The key ministries of the state should be relocated to distinct cities (we call such cities important). However, due to the fact that there is a high risk of an attack by barbarians it must be done carefully. The King has made several plans, each of which is described by a set of important cities, and now wonders what is the best plan.

Barbarians can capture some of the cities that are not important (the important ones will have enough protection for sure), after that the captured city becomes impassable. In particular, an interesting feature of the plan is the minimum number of cities that the barbarians need to capture in order to make all the important cities isolated, that is, from all important cities it would be impossible to reach any other important city.

Help the King to calculate this characteristic for each of his plan.


-----Input-----

The first line of the input contains integer n (1 ≤ n ≤ 100 000) — the number of cities in the kingdom.

Each of the next n - 1 lines contains two distinct integers u_{i}, v_{i} (1 ≤ u_{i}, v_{i} ≤ n) — the indices of the cities connected by the i-th road. It is guaranteed that you can get from any city to any other one moving only along the existing roads.

The next line contains a single integer q (1 ≤ q ≤ 100 000) — the number of King's plans.

Each of the next q lines looks as follows: first goes number k_{i} — the number of important cities in the King's plan, (1 ≤ k_{i} ≤ n), then follow exactly k_{i} space-separated pairwise distinct numbers from 1 to n — the numbers of important cities in this plan.

The sum of all k_{i}'s does't exceed 100 000.


-----Output-----

For each plan print a single integer — the minimum number of cities that the barbarians need to capture, or print  - 1 if all the barbarians' attempts to isolate important cities will not be effective.


-----Examples-----
Input
4
1 3
2 3
4 3
4
2 1 2
3 2 3 4
3 1 2 4
4 1 2 3 4

Output
1
-1
1
-1

Input
7
1 2
2 3
3 4
1 5
5 6
5 7
1
4 2 4 6 7

Output
2



-----Note-----

In the first sample, in the first and the third King's plan barbarians can capture the city 3, and that will be enough. In the second and the fourth plans all their attempts will not be effective.

In the second sample the cities to capture are 3 and 5.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import sys\nfrom collections import deque\ndef solve():\n    sys.setrecursionlimit(10**6)\n    readline = sys.stdin.readline\n    writelines = sys.stdout.writelines\n    N = int(readline())\n    G = [[] for i in range(N)]\n    for i in range(N-1):\n        u, v = map(int, readline().split())\n        G[u-1].append(v-1)\n        G[v-1].append(u-1)\n\n    # Euler tour technique\n    S = []\n    FS = [0]*N; LS = [0]*N\n    depth = [0]*N\n    stk = [-1, 0]\n    it = [0]*N\n    while len(stk) > 1:\n        v = stk[-1]\n        i = it[v]\n        if i == 0:\n            FS[v] = len(S)\n            depth[v] = len(stk)\n        if i < len(G[v]) and G[v][i] == stk[-2]:\n            it[v] += 1\n            i += 1\n        if i == len(G[v]):\n            LS[v] = len(S)\n            stk.pop()\n        else:\n            stk.append(G[v][i])\n            it[v] += 1\n        S.append(v)\n\n    L = len(S)\n    lg = [0]*(L+1)\n    # Sparse Table\n    for i in range(2, L+1):\n        lg[i] = lg[i >> 1] + 1\n    st = [[L]*(L - (1 << i) + 1) for i in range(lg[L]+1)]\n    st[0][:] = S\n    b = 1\n    for i in range(lg[L]):\n        st0 = st[i]\n        st1 = st[i+1]\n        for j in range(L - (b<<1) + 1):\n            st1[j] = (st0[j] if depth[st0[j]] <= depth[st0[j+b]] else st0[j+b])\n        b <<= 1\n\n    INF = 10**18\n    ans = []\n    Q = int(readline())\n    G0 = [[]]*N\n    P = [0]*N\n    deg = [0]*N\n    KS = [0]*N\n    A = [0]*N\n    B = [0]*N\n    for t in range(Q):\n        k, *vs = map(int, readline().split())\n        for i in range(k):\n            vs[i] -= 1\n            KS[vs[i]] = 1\n        vs.sort(key=FS.__getitem__)\n        for i in range(k-1):\n            x = FS[vs[i]]; y = FS[vs[i+1]]\n            l = lg[y - x + 1]\n            w = st[l][x] if depth[st[l][x]] <= depth[st[l][y - (1 << l) + 1]] else st[l][y - (1 << l) + 1]\n            vs.append(w)\n        vs.sort(key=FS.__getitem__)\n        stk = []\n        prv = -1\n        for v in vs:\n            if v == prv:\n                continue\n            while stk and LS[stk[-1]] < FS[v]:\n                stk.pop()\n            if stk:\n                G0[stk[-1]].append(v)\n            G0[v] = []\n            it[v] = 0\n            stk.append(v)\n            prv = v\n        que = deque()\n        prv = -1\n        P[vs[0]] = -1\n        for v in vs:\n            if v == prv:\n                continue\n            for w in G0[v]:\n                P[w] = v\n            deg[v] = len(G0[v])\n            if deg[v] == 0:\n                que.append(v)\n            prv = v\n\n        while que:\n            v = que.popleft()\n            if KS[v]:\n                a = 0\n                for w in G0[v]:\n                    ra = A[w]; rb = B[w]\n                    if depth[v]+1 < depth[w]:\n                        a += min(ra, rb+1)\n                    else:\n                        a += ra\n                A[v] = INF\n                B[v] = a\n            else:\n                a = 0; b = c = INF\n                for w in G0[v]:\n                    ra = A[w]; rb = B[w]\n                    a, b, c = a + ra, min(a + rb, b + ra), min(b + rb, c + min(ra, rb))\n                A[v] = min(a, b+1, c+1)\n                B[v] = b\n\n            p = P[v]\n            if p != -1:\n                deg[p] -= 1\n                if deg[p] == 0:\n                    que.append(p)\n        v = min(A[vs[0]], B[vs[0]])\n        if v >= INF:\n            ans.append("-1\\n")\n        else:\n            ans.append("%d\\n" % v)\n        for v in vs:\n            KS[v] = 0\n\n    writelines(ans)\nsolve()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 18025