A and B are preparing themselves for programming contests.

The University where A and B study is a set of rooms connected by corridors. Overall, the University has n rooms connected by n - 1 corridors so that you can get from any room to any other one by moving along the corridors. The rooms are numbered from 1 to n.

Every day А and B write contests in some rooms of their university, and after each contest they gather together in the same room and discuss problems. A and B want the distance from the rooms where problems are discussed to the rooms where contests are written to be equal. The distance between two rooms is the number of edges on the shortest path between them.

As they write contests in new rooms every day, they asked you to help them find the number of possible rooms to discuss problems for each of the following m days.

Input

The first line contains integer n (1 ≤ n ≤ 105) — the number of rooms in the University.

The next n - 1 lines describe the corridors. The i-th of these lines (1 ≤ i ≤ n - 1) contains two integers ai and bi (1 ≤ ai, bi ≤ n), showing that the i-th corridor connects rooms ai and bi.

The next line contains integer m (1 ≤ m ≤ 105) — the number of queries.

Next m lines describe the queries. The j-th of these lines (1 ≤ j ≤ m) contains two integers xj and yj (1 ≤ xj, yj ≤ n) that means that on the j-th day A will write the contest in the room xj, B will write in the room yj.

Output

In the i-th (1 ≤ i ≤ m) line print the number of rooms that are equidistant from the rooms where A and B write contest on the i-th day.

Examples

Input

4
1 2
1 3
2 4
1
2 3


Output

1


Input

4
1 2
2 3
2 4
2
1 2
1 3


Output

0
2

Note

in the first sample there is only one room at the same distance from rooms number 2 and 3 — room number 1.
#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long l, long long md) {
  a %= md;
  long long res = 1;
  while (l) {
    if (l & 1) res = res * a % md;
    l /= 2;
    a = a * a % md;
  }
  return res;
}
long long binpow(long long a, long long l) {
  long long res = 1;
  while (l) {
    if (l & 1) res = res * a;
    l /= 2;
    a = a * a;
  }
  return res;
}
long long invmod(long long a, long long md) { return powmod(a, md - 2, md); }
long long __set(long long b, long long i) { return b | (1LL << i); }
long long __unset(long long b, long long i) { return b & (~(1UL << i)); }
long long __check(long long b, long long i) { return b & (1LL << i); }
long long mulmod(long long a, long long b, long long md) {
  return (((a % md) * (b % md)) % md + md) % md;
}
long long addmod(long long a, long long b, long long md) {
  return ((a % md + b % md) % md + md) % md;
}
long long submod(long long a, long long b, long long md) {
  return (((a % md - b % md) % md) + md) % md;
}
long long divmod(long long a, long long b, long long md) {
  return mulmod(a, powmod(b, md - 2, md), md);
}
const long long inf = 0xFFFFFFFFFFFFFFFL;
priority_queue<long long, vector<long long>, greater<long long> > pq;
long long n;
vector<vector<long long> > g(100010);
struct AncestorK {
 public:
  long long n, m, depth, root, timer;
  vector<vector<long long> > g;
  vector<vector<long long> > table;
  vector<long long> dis, parent, tin, tout, sub;
  void dfs(long long u) {
    tin[u] = ++timer;
    for (long long v : g[u]) {
      if (dis[v] == -1) {
        dis[v] = dis[u] + 1;
        depth = max(depth, dis[v]);
        parent[v] = u;
        table[v][0] = u;
        dfs(v);
        sub[u] += sub[v];
      }
    }
    tout[u] = ++timer;
  }
  void compute() {
    dis[root] = 0;
    dfs(root);
    for (long long i = 0; i < m - 1; i++) {
      for (long long u = 0; u < n; u++) {
        long long v1 = table[u][i];
        if (v1 != -1) {
          v1 = table[v1][i];
          if (v1 != -1) table[u][i + 1] = v1;
        }
      }
    }
  }
  long long is_ancestor(long long u, long long v) {
    return tin[u] <= tin[v] && tout[u] >= tout[v];
  }
  AncestorK(vector<vector<long long> >& __g, long long __root = 0) {
    g = __g, root = __root, n = (long long)(g.size()),
    m = (long long)log2(n) + 1, depth = 0, timer = 0;
    dis.assign(n, -1);
    parent.assign(n, -1);
    tin.assign(n, 0);
    tout.assign(n, 0);
    sub.assign(n, 1);
    for (long long i = 0; i < n; i++) {
      vector<long long> tp(m, -1);
      table.push_back(tp);
    }
    compute();
  }
  long long kth_ancestor(long long u, long long k) {
    if (dis[u] < k) return -1;
    if (k == 0) return u;
    long long c = u;
    for (long long bit = 0; bit < m; ++bit) {
      if (c == -1) return -1;
      if ((k & (1ll << bit))) c = table[c][bit];
    }
    return c;
  }
  long long lca(long long u, long long v) {
    if (is_ancestor(u, v)) return u;
    if (is_ancestor(v, u)) return v;
    for (long long i = m - 1; i >= 0; --i) {
      if (table[u][i] == -1) continue;
      if (!is_ancestor(table[u][i], v)) u = table[u][i];
    }
    return table[u][0];
  }
};
signed main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }
  AncestorK lc(g);
  long long q;
  cin >> q;
  while (q--) {
    long long x, y;
    cin >> x >> y;
    x--;
    y--;
    long long l = lc.lca(x, y);
    if (x == y) {
      cout << n << "\n";
      continue;
    }
    if (lc.dis[x] == lc.dis[y]) {
      long long vx = lc.kth_ancestor(x, lc.dis[x] - lc.dis[l] - 1),
                vy = lc.kth_ancestor(y, lc.dis[y] - lc.dis[l] - 1);
      cout << n - lc.sub[vx] - lc.sub[vy] << "\n";
    } else {
      long long d = lc.dis[x] - lc.dis[l] + lc.dis[y] - lc.dis[l];
      if (d % 2) {
        cout << 0 << "\n";
        continue;
      }
      if (lc.dis[x] > lc.dis[y]) {
        long long pt = lc.kth_ancestor(x, d / 2);
        long long ux = lc.kth_ancestor(x, d / 2 - 1);
        cout << lc.sub[pt] - lc.sub[ux] << "\n";
      } else {
        long long pt = lc.kth_ancestor(y, d / 2);
        long long uy = lc.kth_ancestor(y, d / 2 - 1);
        cout << lc.sub[pt] - lc.sub[uy] << "\n";
      }
    }
  }
  return 0;
}
