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 EMain {
    String noResultMessage = "NoResult";
    Parser in = new Parser();
    PrintWriter out;

    int n = in.nextInteger();

    public void solve() {
        int a[] = new int[n-1];
        int b[] = new int[n-1];
        for(int i = 0; i < n-1; ++i){
            a[i] = in.nextInteger()-1;
            b[i] = in.nextInteger()-1;
        }
        Tree tree = new Tree(a, b);
        tree.hang(n-1);

        int m = in.nextInteger();
        for(int i = 0; i < m; ++i){
            int x = in.nextInteger() - 1;
            int y = in.nextInteger() - 1;
            if(x == y){
                out.println(n);
                continue;
            }
            int lx = tree.level(x);
            int ly = tree.level(y);
            int lc = tree.level(tree.common(x, y));

            if((lx + ly) % 2 == 1){
                out.println(0);
                continue;
            }
            int up = (lx + ly - 2*lc) / 2 - 1;
            if (lx == ly) {
                out.println(n - tree.children(tree.up(x, up)) - tree.children(tree.up(y, up)));
            } else {
                int ch = tree.up(lx > ly ? x : y, up);
                out.println(tree.children(tree.up(ch, 1)) - tree.children(ch));
            }
        }
    }

    static public class Tree {
        final int n;
        final int[][] edges;
        int[][] parent;
        int[] level;
        int[] childrenCount;
        int degree = 1;


        public Tree(int[] x, int[] y) {
            this.n = x.length + 1;
            edges = new int[n][];

            int[] edgeCounts = new int[n];
            for(int i : x)++edgeCounts[i];
            for(int i : y)++edgeCounts[i];
            for(int i = 0; i < n; ++i)edges[i] = new int[edgeCounts[i]];
            for(int i = 0; i < n-1; ++i){
                edges[x[i]][--edgeCounts[x[i]]] = y[i];
                edges[y[i]][--edgeCounts[y[i]]] = x[i];
            }
        }

        public void hang(int root){
            while((1<<degree) < n) ++degree;
            parent = new int[degree + 1][n];
            level = new int[n];
            childrenCount = new int[n];

            int[] order = new int[n];
            int first = 0;
            int last = 0;
            order[last++] = root;
            parent[0][root] = -1;
            while(first < last){
                int curr = order[first++];
                int p = parent[0][curr];
                for(int child : edges[curr]){
                    if(child == p)continue;
                    parent[0][child] = curr;
                    level[child] = level[curr] + 1;
                    order[last++] = child;
                }
            }
            for(int i = n-1; i > 0; --i){
                childrenCount[parent[0][order[i]]] += ++childrenCount[order[i]];
            }
            for(int d = 1; d <= degree; ++d)
                for (int i = 0; i < n; ++i){
                    int dp = parent[d-1][i];
                    parent[d][i] = dp < 0 ? -1 : parent[d-1][dp];
                }
        }

        public int up(int v, int height){
            for(int d = degree; d >= 0; --d){
                if(height < (1<<d))continue;
                height -= 1<<d;
                v = parent[d][v];
            }
            return v;
        }

        public int common(int v1, int v2){
            if(level[v1] < level[v2]) return common(v2, v1);
            v1 = up(v1, level[v1] - level[v2]);
            if(v1 == v2) return v1;
            for(int d = degree; d >= 0; --d){
                if(parent[d][v1] == parent[d][v2])continue;
                v1 = parent[d][v1];
                v2 = parent[d][v2];
            }
            return parent[0][v1];
        }

        public int level(int v){
            return level[v];
        }

        public int children(int v){
            return childrenCount[v];
        }
    }


    static public class Parser{
        Scanner scanner;

        public Parser() {
            scanner = new Scanner(System.in).useLocale(Locale.ENGLISH);
        }

        public Parser(String str) {
            scanner = new Scanner(str).useLocale(Locale.ENGLISH);
        }

        long nextLong(){
            return scanner.nextLong();
        }

        int nextInteger(){
            return scanner.nextInt();
        }

        double nextDouble(){
            return scanner.nextDouble();
        }

        String nextLine(){
            return scanner.nextLine();
        }

        String next(){
            return scanner.next();
        }

        int[] nextIntegers(int count){
            int[] result = new int[count];
            for(int i = 0; i < count; ++i){
                result[i] = nextInteger();
            }
            return result;
        }

        long[] nextLongs(int count){
            long[] result = new long[count];
            for(int i = 0; i < count; ++i){
                result[i] = nextLong();
            }
            return result;
        }

        int[][] nextIntegers(int fields, int count){
            int[][] result = new int[fields][count];
            for(int c = 0; c < count; ++c){
                for(int i = 0; i < fields; ++i){
                    result[i][c] = nextInteger();
                }
            }
            return result;
        }
    }

    void noResult(){
        throw new NoResultException();
    }

    void noResult(String str){
        throw new NoResultException(str);
    }

    void run(){
        try{
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            out = new PrintWriter(System.out);
            solve();
            out.close();
            System.out.print(outStream.toString());
        } catch (NoResultException exc){
            System.out.print(null == exc.response ? noResultMessage : exc.response);
        }
    }

    public static void main(String[] args) {
        new EMain().run();
    }

    public static class NoResultException extends RuntimeException{
        private String response;

        public NoResultException(String response) {
            this.response = response;
        }

        public NoResultException() {
        }
    }
}
