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.
// Don't place your source in a package


import javax.swing.*;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
import java.util.stream.Stream;



// Please name your class Main
public class Main {
    static FastScanner fs=new FastScanner();
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }
        int Int() {
            return Integer.parseInt(next());
        }

        long Long() {
            return Long.parseLong(next());
        }

        String Str(){
            return next();
        }
    }


    public static void main (String[] args) throws java.lang.Exception {
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        //reading /writing file
        //Scanner sc=new Scanner(new File("input.txt"));
        //PrintWriter pr=new PrintWriter("output.txt");


        int T=1;
        for(int t=0;t<T;t++){
            int n=Int();
            int edges[][]=new int[n-1][2];
            for(int i=0;i<edges.length;i++){
                edges[i][0]=Int()-1;
                edges[i][1]=Int()-1;
            }

            int m=Int();
            int q[][]=new int[m][2];
            for(int i=0;i<m;i++){
                q[i][0]=Int()-1;
                q[i][1]=Int()-1;
            }

            Solution sol=new Solution(out);
            sol.solution(n,edges,q);
        }
        out.close();

    }




    public static int[] Arr(int n){
        int A[]=new int[n];
        for(int i=0;i<n;i++)A[i]=Int();
        return A;
    }
    public static int Int(){
        return fs.Int();
    }
    public static long Long(){
        return fs.Long();
    }
    public static String Str(){
        return fs.Str();
    }

}








class Solution {
    PrintWriter out;
    int INF = Integer.MAX_VALUE;
    int MOD = 1000000007;
    long mod = 1000000007;
    public Solution(PrintWriter out) {
        this.out = out;
    }


    List<Integer>graph[];
    int levels[];
    int cnts[];
    int f[][];
    public void solution(int n, int edges[][],int q[][]) {
        graph=new ArrayList[n];
        levels=new int[n];
        cnts=new int[n];
        f=new int[n][21];
        Arrays.setAll(graph,e->new ArrayList<>());
        for(int edge[]:edges){
            graph[edge[0]].add(edge[1]);
            graph[edge[1]].add(edge[0]);
        }

        for(int i=0;i<f.length;i++){
            Arrays.fill(f[i],-1);
        }


        dfs(-1,0,0);

        //construc sparse table
        for(int i=1;i<f[0].length;i++){//construc sparse table
            for(int j=0;j<n;j++){
                int parent=f[j][i-1];
                if(parent!=-1&&f[parent][i-1]!=-1){
                    f[j][i]=f[parent][i-1];
                }
            }
        }

        for(int pair[]:q){
            int u=pair[0],v=pair[1];
            if(u==v){
                out.println(n);
                continue;
            }

            int lca = LCA(u,v);
            int line = levels[u] - levels[lca] + levels[v] - levels[lca] + 1;

            if(line%2==0){
                out.println(0);
            }
            else{
                int low = u;
                int high = v;
                if(levels[v]>levels[u]){
                    low=v;
                    high=u;
                }

                int dis = line/2;
                int mid = walk(low,dis);

                //System.out.println((low+1)+" "+(high+1));
                //System.out.println((mid+1)+" "+(lca+1)+"  "+dis);

                if(mid==lca){
                    int res=n;
                    int mid1 = walk(low,dis-1);
                    int mid2 = walk(high,dis-1);
                    //System.out.println(mid1+" "+mid2);
                    res-=(cnts[mid1]+cnts[mid2]);
                    out.println(res);
                }
                else{
                    if(LCA(low,mid)==mid){
                        int mid1=walk(low,levels[low]-levels[mid]-1);
                        out.println(cnts[mid]-cnts[mid1]);
                    }
                    else{
                        int mid1=walk(high,levels[high]-levels[mid]-1);
                        out.println(cnts[mid]-cnts[mid1]);
                    }
                }

            }

        }
    }


    public int walk(int cur,int dis){
        for(int i=20;i>=0;i--){
            if((dis&(1<<i))!=0){
                cur=f[cur][i];
            }
        }
        return cur;
    }

    public int LCA(int x,int y){
        if(levels[x]<levels[y]){
            return LCA(y,x);
        }


        for(int i=20; i>=0; i--) {
            if(f[x][i]!=-1&&levels[f[x][i]] >= levels[y]) {
                x = f[x][i];
            }
        }
        if(x == y) return x;


        for(int i=20; i>=0; i--)//不重合，x 和 y 一起往上跳
        {
            if(f[x][i] != f[y][i]) //只要父亲不同，就跳，父亲相同，就停了
            {                    // 最后一次，是没有跳上去的

                x = f[x][i];
                y = f[y][i];
            }
        }
        return f[x][0];
    }

    public int dfs(int parent,int root,int level){
        int cnt = 1;
        levels[root]=level;
        for(int next:graph[root]){
            if(next!=parent){
                f[next][0]=root;
                cnt+=dfs(root,next,level+1);
            }
        }
        cnts[root]=cnt;
        return cnt;
    }

}








