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.
//package train1;

import java.io.*;
import java.util.*;
import java.util.StringTokenizer;

public class main519C {
    public static PrintWriter out = new PrintWriter(System.out);
    public static FastScanner enter = new FastScanner(System.in);

    public static void main(String[] args) throws IOException {
        int n=enter.nextInt();
        Graph g =new Graph(n);
        g.read();
    }


    static class Graph {
        int n;
        int m;
        LinkedList<Integer>[] vert;
        HashMap<pair, Long> ed;
        boolean used[];

        static class pair {
            int u, w;

            public pair(int u, int w) {
                this.u = u;
                this.w = w;
            }

            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                pair pair = (pair) o;
                return u == pair.u &&
                        w == pair.w;
            }

            @Override
            public int hashCode() {

                return Objects.hash(u, w);
            }
        }

        public Graph(int n) {
            this.n = n;
            vert = new LinkedList[n + 1]; //1 ,...., n
            for (int i = 1; i < n + 1; i++) vert[i] = new LinkedList<>();
            used = new boolean[n + 1];
            ed = new HashMap<>();
        }
        public void add(int a, int b) {
            vert[a].addLast(b);
        }
        public int[] degree;
        public int[] height;
        HashMap<pair, Integer> lcaHm=new HashMap<>();
        public int parent[][];
        public int maxlog;
        public void read() throws IOException {
            maxlog=(int)((Math.log(n+1)+1)/(Math.log(2)));
            parent=new int[n+1][maxlog];
            for (int i = 0; i <n-1 ; i++) {
                int a=enter.nextInt();
                int b=enter.nextInt();
                add(a,b);
                add(b,a);
            }
            degree=new int[n+1];
            height=new int[n+1];
            preprocessing();
            int m=enter.nextInt();
            for (int i = 0; i <m ; i++) {
                int u=enter.nextInt();
                int w=enter.nextInt();
                int result=lca(u,w);
                int ans=solve(result, u, w);
                out.println(ans);
            }
            out.close();
        }

        private int solve(int anc, int u, int v){
            if(u==v) return n;
            int k=(height[u]+height[v]-2*height[anc]+1);
            if( k%2==0) return 0;
            k/=2;
            if(height[u]<height[v]){
                int tmp=u;
                u=v;
                v=tmp;
            }
            //now our vert is at path from u to p
            if(height[u]-k==height[anc]){
                int l=find(u,k-1);
                int r=find(v,k-1);
                return n-degree[l]-degree[r];
            }
            int l=find(u, k-1);
            int r=find(u, k);
            return degree[r]-degree[l];
        }

        private int find (int v, int len){
            int h=height[v]-len;
            for (int i = maxlog-1; i >=0 ; i--) {
                if(parent[v][i]>=1 &&height[parent[v][i]]>=h) v=parent[v][i];
            }
            return v;

        }

        public int lca (int u, int v){
            if(height[u]<height[v]){
                int tmp=v;
                v=u;
                u=tmp;
            }
            //now h[u]>=h[v] always

            for (int i = maxlog-1; i >=0 ; i--) {
                if(parent[u][i]>=1 && height[parent[u][i]]>=height[v]){
                    u=parent[u][i];
                }
            }
            //now h[u]=h[v]
            if(u==v) return u;
            for (int i = maxlog-1; i >=0 ; i--) {
                if(parent[u][i]!=parent[v][i]) {
                    u=parent[u][i];
                    v=parent[v][i];
                }
            }
            return parent[u][0];

        }

        void DFSUtilForLca(int v, boolean was[], int from) {
            was[v] = true;
            parent[v][0]=from;
            for (int i = 1; i <maxlog ; i++) {
                if(parent[v][i-1]>=1) parent[v][i]=parent[parent[v][i-1]][i-1];
            }
            for (int n : vert[v]) {
                if (!was[n]) {
                    DFSUtilForLca(n, was, v);
                }
            }
        }

        void DFSForLca(int v) {
            boolean was[] = new boolean[n + 1];
            DFSUtilForLca(v, was, -1);
        }

        private void preprocessing(){
            DFSForDegree(1);
            DFSForLca(1);
        }

        void DFSUtilForDegree(int v, boolean was[]) {
            was[v] = true;
            int summ=0;
            for (int n : vert[v]) {
                if (!was[n]) {
                    height[n]=height[v]+1;
                    DFSUtilForDegree(n, was);
                    summ+=degree[n];
                }
            }
            degree[v]=summ+1;
        }

        void DFSForDegree(int v) {
            boolean was[] = new boolean[n + 1];
            DFSUtilForDegree(v, was);
        }






    }


    static class FastScanner {
        BufferedReader br;
        StringTokenizer stok;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() throws IOException {
            while (stok == null || !stok.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null) {
                    return null;
                }
                stok = new StringTokenizer(s);
            }
            return stok.nextToken();
        }

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

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

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

        char nextChar() throws IOException {
            return (char) (br.read());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }
    }
}

