#include <bits/stdc++.h>
using namespace std;
inline int read_int() {
  int t = 0;
  bool sign = false;
  char c = getchar();
  while (!isdigit(c)) {
    sign |= c == '-';
    c = getchar();
  }
  while (isdigit(c)) {
    t = (t << 1) + (t << 3) + (c & 15);
    c = getchar();
  }
  return sign ? -t : t;
}
inline long long read_LL() {
  long long t = 0;
  bool sign = false;
  char c = getchar();
  while (!isdigit(c)) {
    sign |= c == '-';
    c = getchar();
  }
  while (isdigit(c)) {
    t = (t << 1) + (t << 3) + (c & 15);
    c = getchar();
  }
  return sign ? -t : t;
}
inline char get_char() {
  char c = getchar();
  while (c == ' ' || c == '\n' || c == '\r') c = getchar();
  return c;
}
inline void write(long long x) {
  register char c[21], len = 0;
  if (!x) return putchar('0'), void();
  if (x < 0) x = -x, putchar('-');
  while (x) c[++len] = x % 10, x /= 10;
  while (len) putchar(c[len--] + 48);
}
inline void space(long long x) { write(x), putchar(' '); }
inline void enter(long long x) { write(x), putchar('\n'); }
const int MAXN = 1e5 + 5;
namespace T {
struct Edge {
  int to, next;
} edge[MAXN << 1];
int head[MAXN], edge_cnt;
void Insert(int u, int v) {
  edge[++edge_cnt] = Edge{v, head[u]};
  head[u] = edge_cnt;
  edge[++edge_cnt] = Edge{u, head[v]};
  head[v] = edge_cnt;
}
int d[MAXN], sz[MAXN], f[MAXN], dfn[MAXN], dfs_t;
int h_son[MAXN], mson[MAXN], p[MAXN];
void dfs_1(int u, int fa, int depth) {
  sz[u] = 1;
  f[u] = fa;
  d[u] = depth;
  mson[u] = 0;
  for (int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    dfs_1(v, u, depth + 1);
    sz[u] += sz[v];
    if (sz[v] > mson[u]) {
      h_son[u] = v;
      mson[u] = sz[v];
    }
  }
}
void dfs_2(int u, int top) {
  dfn[u] = ++dfs_t;
  p[u] = top;
  if (mson[u]) dfs_2(h_son[u], top);
  for (int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == f[u] || v == h_son[u]) continue;
    dfs_2(v, v);
  }
}
int LCA(int u, int v) {
  while (p[u] != p[v]) {
    if (d[p[u]] < d[p[v]]) swap(u, v);
    u = f[p[u]];
  }
  if (d[u] > d[v]) swap(u, v);
  return u;
}
}  // namespace T
struct Edge {
  int to, next;
} edge[MAXN];
int head[MAXN], edge_cnt;
void Insert(int u, int v) {
  edge[++edge_cnt] = Edge{v, head[u]};
  head[u] = edge_cnt;
}
struct cmp {
  bool operator()(const int a, const int b) const {
    return T::dfn[a] < T::dfn[b];
  }
};
int Stack[MAXN], top, node[MAXN];
bool is_key[MAXN];
bool build(int k) {
  for (int i = (0); i < (k); ++i) {
    if (is_key[T::f[node[i]]]) return false;
  }
  edge_cnt = 0;
  sort(node, node + k, cmp());
  Stack[top = 1] = 1;
  head[1] = 0;
  for (int i = (0); i < (k); ++i) {
    if (node[i] == 1) continue;
    int p = T::LCA(Stack[top], node[i]);
    if (p != Stack[top]) {
      while (T::dfn[p] < T::dfn[Stack[top - 1]])
        Insert(Stack[top - 1], Stack[top]), top--;
      if (p != Stack[top - 1])
        head[p] = 0, Insert(p, Stack[top]), Stack[top] = p;
      else
        Insert(Stack[top - 1], Stack[top]), top--;
    }
    head[node[i]] = 0, Stack[++top] = node[i];
  }
  while (top > 1) Insert(Stack[top - 1], Stack[top]), top--;
  return true;
}
int dp[MAXN][2];
void dfs(int u, int fa) {
  for (int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    dfs(v, u);
    dp[u][0] += dp[v][0];
    dp[u][1] += dp[v][1];
  }
  if (is_key[u]) {
    dp[u][0] += dp[u][1];
    dp[u][1] = 1;
  } else if (dp[u][1] > 1) {
    dp[u][0]++;
    dp[u][1] = 0;
  }
}
void dfs2(int u, int fa) {
  dp[u][0] = dp[u][1] = 0;
  is_key[u] = false;
  for (int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    dfs2(v, u);
  }
}
int main() {
  int n = read_int(), root = 1;
  for (int i = (1); i < (n); ++i) {
    int u = read_int(), v = read_int();
    T::Insert(u, v);
  }
  T::dfs_1(root, 0, 0);
  T::dfs_2(root, root);
  int q = read_int();
  while (q--) {
    int k = read_int();
    for (int i = (0); i < (k); ++i) {
      node[i] = read_int();
      is_key[node[i]] = true;
    }
    if (!build(k)) {
      for (int i = (0); i < (k); ++i) is_key[node[i]] = false;
      enter(-1);
      continue;
    }
    dfs(root, 0);
    enter(dp[root][0]);
    dfs2(root, 0);
  }
  return 0;
}
