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;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
const int LN = 19;
vector<int> graph[100000 + 7];
int par[100000 + 7][LN + 1], depth[100000 + 7], room[100000 + 7], n;
void dfs(int cur = 1, int pr = -1, int dep = 0) {
  par[cur][0] = pr;
  depth[cur] = dep;
  int v;
  room[cur] = 1;
  for (int i = 0; i < graph[cur].size(); i++) {
    v = graph[cur][i];
    if (v == pr) continue;
    dfs(v, cur, dep + 1);
    room[cur] += room[v];
  }
}
void build_lca() {
  for (int i = 1; i <= LN; i++) {
    for (int j = 1; j <= n; j++) {
      if (par[j][i - 1] != -1) par[j][i] = par[par[j][i - 1]][i - 1];
    }
  }
}
int solve(int u, int v) {
  int ans = 0, node = 0, su = u, sv = v, temp;
  if (depth[v] > depth[u]) swap(u, v);
  su = u;
  sv = v;
  for (int i = LN; i >= 0; i--) {
    if (depth[u] - (1 << i) >= depth[v]) {
      node += (1 << i);
      u = par[u][i];
    }
  }
  if (u == v) {
    if (node & 1) return -1;
    node = node / 2;
    temp = depth[v] + node;
    ans = -room[su];
    for (int i = LN; i >= 0; i--) {
      if (depth[su] - (1 << i) > temp) su = par[su][i];
    }
    ans = room[par[su][0]] - room[su];
    return ans;
  }
  for (int i = LN; i >= 0; i--) {
    if (par[u][i] != par[v][i]) {
      u = par[u][i];
      v = par[v][i];
      node += (1 << (i + 1));
    }
  }
  node += 2;
  if (node & 1) return -1;
  if (depth[su] == depth[sv]) {
    ans = n - room[u] - room[v];
    return ans;
  }
  u = su;
  temp = node / 2;
  temp = depth[u] - temp;
  for (int i = LN; i >= 0; i--) {
    if (depth[u] - (1 << i) > temp) u = par[u][i];
  }
  ans = room[par[u][0]] - room[u];
  return ans;
}
int main() {
  int u, v, q, ans;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  memset(par, -1, sizeof(par));
  dfs();
  build_lca();
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf("%d %d", &u, &v);
    if (u == v) {
      printf("%d\n", n);
      continue;
    }
    ans = solve(u, v);
    if (ans == -1)
      printf("0\n");
    else
      printf("%d\n", ans);
  }
  return 0;
}
