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;
const long long int MAX = 1e5 + 2;
const long long int MAX1 = 1e2 + 5;
const long long int INF = 1e15 + 2;
const long long int MOD = 1e9 + 7;
inline long long int nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long int read() {
  long long int ret = 0;
  bool f = 0;
  char ch = nc();
  while (ch > '9' || ch < '0') f ^= ch == '-', ch = nc();
  while (ch <= '9' && ch >= '0') ret = ret * 10 + ch - '0', ch = nc();
  return f ? -ret : ret;
}
long long int power(long long int base, long long int ind, long long int mod) {
  long long int res = 1;
  while (ind) {
    if (ind & 1) res = (res * base) % mod;
    base = (base * base) % mod;
    ind >>= 1;
  }
  return res;
}
long long int inv(long long int den, long long int mod) {
  return power(den, mod - 2, mod);
}
long long int n, m;
vector<long long int> graph[MAX];
long long int sz[MAX], par[MAX][20], lvl[MAX];
void init() {
  for (long long int i = 0; i < (n + 1); ++i) graph[i].clear();
  memset(sz, 0, sizeof(sz));
  memset(par, -1, sizeof(par));
  memset(lvl, -1, sizeof(lvl));
}
void input() {
  for (long long int i = 0; i < (n - 1); ++i) {
    long long int u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
}
void dfs(long long int rt, long long int p) {
  lvl[rt] = 1 + lvl[p];
  par[rt][0] = p;
  sz[rt] = 1;
  for (auto& child : graph[rt]) {
    if (child != p) {
      dfs(child, rt);
      sz[rt] += sz[child];
    }
  }
}
long long int lca(long long int u, long long int v) {
  if (lvl[u] < lvl[v]) swap(u, v);
  long long int lg = 0;
  for (; (1 << lg) <= lvl[u]; lg++)
    ;
  lg--;
  for (int i = lg; i >= 0; i--) {
    if (lvl[u] - (1 << i) >= lvl[v]) u = par[u][i];
  }
  if (u == v) return u;
  for (int i = lg; i >= 0; i--) {
    if (par[u][i] != -1 and par[u][i] != par[v][i])
      u = par[u][i], v = par[v][i];
  }
  return par[u][0];
}
void pre() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < 20; j++) {
      if (par[i][j - 1] != -1) {
        par[i][j] = par[par[i][j - 1]][j - 1];
      }
    }
  }
}
long long int findPar(long long int u, long long int dist) {
  if (dist <= 0) return u;
  long long int lg = 0;
  for (; (1 << lg) <= lvl[u]; lg++)
    ;
  lg--;
  for (int i = lg; i >= 0; i--) {
    if (dist >= (1 << i)) {
      u = par[u][i];
      dist -= (1 << i);
    }
  }
  return u;
}
void query() {
  cin >> m;
  while (m--) {
    long long int u, v;
    cin >> u >> v;
    long long int lc = lca(u, v);
    if (u == v) {
      cout << n << endl;
      continue;
    }
    long long int ans;
    if (lvl[u] == lvl[v]) {
      long long int h1 = lvl[u] - lvl[lc] - 1;
      long long int p1 = findPar(u, h1);
      long long int p2 = findPar(v, h1);
      ans = n - sz[p1] - sz[p2];
    } else {
      long long int dist = lvl[u] + lvl[v] - 2 * lvl[lc];
      if (dist % 2)
        ans = 0;
      else {
        long long int sub;
        if (lvl[u] > lvl[v]) {
          long long int p1 = findPar(u, dist / 2);
          long long int p2 = findPar(u, (dist / 2) - 1);
          sub = n - sz[p1] + sz[p2];
        } else {
          long long int p1 = findPar(v, dist / 2);
          long long int p2 = findPar(v, (dist / 2) - 1);
          sub = n - sz[p1] + sz[p2];
        }
        ans = n - sub;
      }
    }
    cout << ans << endl;
  }
}
int main() {
  cin >> n;
  init();
  input();
  dfs(1, 0);
  pre();
  query();
}
