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.
import java.io.*;
import java.util.*;

public class Task {
    static FastScanner in;
    static PrintWriter out;
    static PrintStream err;

    void solve() throws IOException {
        int n = in.nextInt();
        Graph g = new Graph(n);
        for (int i = 0; i < n - 1; ++i) {
            g.addEdge(in.nextInt() - 1, in.nextInt() - 1);
        }
        g.init();
        int m = in.nextInt();
        for (int i = 0; i < m; ++i) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            out.println(g.getAnswer(a, b));
        }
    }

    public static void main(String[] args) {
        try {
            in = new FastScanner();
            out = new PrintWriter(System.out);
            err = System.err;
            new Task().solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}

class FastScanner {
    BufferedReader br;
    StringTokenizer in;

    FastScanner() {
        this.br = new BufferedReader(new InputStreamReader(System.in));
    }

    FastScanner(String fileName) throws FileNotFoundException {
        this.br = new BufferedReader(new FileReader(new File(fileName)));
    }

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}

class Graph {
    int n;
    int m;
    ArrayList<Edge>[] edges;
    boolean[] used;
    int[][] pr;
    int[] tin;
    int[] tout;
    int[] under;
    int[] depth;
    int timer;

    public Graph(int n) {
        this.n = n;
        this.m = 0;
        edges = new ArrayList[n];
        for (int i = 0; i < n; ++i) {
            edges[i] = new ArrayList<Edge>();
        }
    }

    static class Edge {
        int from;
        int to;
        Edge rev;

        public Edge(int from, int to) {
            this.from = from;
            this.to = to;
        }
    }

    public void addEdge(int a, int b) {
        Edge e1 = new Edge(a, b);
        Edge e2 = new Edge(b, a);
        e1.rev = e2;
        e2.rev = e1;
        edges[a].add(e1);
        edges[b].add(e2);
        ++m;
    }

    void dfs(int v, int p, Integer d) {
        under[v] = 1;
        depth[v] = d;
        tin[v] = ++timer;
        pr[0][v] = p;
        for (int i = 1; i < pr.length; ++i) {
            pr[i][v] = pr[i - 1][pr[i - 1][v]];
        }
        for (Edge edge : edges[v]) {
            if (edge.to != p) {
                dfs(edge.to, v, d + 1);
                under[v] += under[edge.to];
            }
        }
        tout[v] = ++timer;
    }

    boolean isAncestor(int a, int b) {
        return tin[a] <= tin[b] && tout[b] <= tout[a];
    }

    int getLCA(int a, int b) {
        if (isAncestor(a, b)) return a;
        for (int i = pr.length - 1; i >= 0; --i) {
            if (!isAncestor(pr[i][a], b)) {
                a = pr[i][a];
            }
        }
        return pr[0][a];
    }

    public void init() {
        pr = new int[18][n];
        tin = new int[n];
        tout = new int[n];
        under = new int[n];
        depth = new int[n];
        dfs(0, 0, 0);
    }

    int getAnswer(int a, int b) {
        if (a == b) return n;
        if (depth[a] % 2 != depth[b] % 2) return 0;
        if (depth[a] > depth[b]) {
            int tmp = a;
            a = b;
            b = tmp;
        }
        int v = getLCA(a, b);
        int med = b;
        for (int i = pr.length - 1; i >= 0; --i) {
            int to = pr[i][med];
            if (depth[b] - depth[to] <= depth[to] - depth[v] + depth[a] - depth[v]) {
                med = to;
            }
        }
        int res = med == v ? n : under[med];
//        for (Edge edge : edges[med]) {
//            if (edge.to == pr[0][med]) continue;
//            if (isAncestor(edge.to, a) || isAncestor(edge.to, b)) {
//                res -= under[edge.to];
//            }
//        }
        for (int to : new int[] {a, b}) {
            if (!isAncestor(med, to)) continue;
            int u = to;
            for (int i = pr.length - 1; i >= 0; --i) {
                int k = pr[i][u];
                if (med != k && isAncestor(med, k)) {
                    u = k;
                }
            }
            res -= under[u];
        }
        return res;
    }
}