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.util.*;import java.io.*;import java.math.*;
public class Main
{
    static int[][]spa;
    static int[]lev,sub;
    public static void process()throws IOException
    {
        int n=ni();
        Graph g=new Graph(n);
        for(int i=1;i<n;i++)
            g.addEdge(ni(),ni());
        spa=new int[n+1][20];
        lev=new int[n+1];
        sub=new int[n+1];
        dfs(g,1,1);
        int q=ni();
        while(q-->0)
        {
            int a=ni(),b=ni();
            if(a==b)
                {pn(n);continue;}
            int par=0;
            if((lev[a]+lev[b])%2==1)
                {pn(0);continue;}
            if(lev[a]<lev[b])
            {
                a=a^b;
                b=a^b;
                a=a^b;
            }
            par=lca(a,b);
            int level=lev[par]+(lev[a]-lev[b])/2;
            int node1=a;
            for(int i=19;i>=0;i--)
            {
                if(lev[node1]-level-1>=(1<<i))
                    node1=spa[node1][i];
            }
            int sup=spa[node1][0];
            int node2=b;
            if(lev[a]==lev[b])
            {
                for(int i=19;i>=0;i--)
                    if(lev[node2]-level-1>=(1<<i))
                        node2=spa[node2][i];
                pn(n-sub[node1]-sub[node2]);
            }
            else pn(sub[sup]-sub[node1]);
        }
    }
    static int lca(int u,int v)
    {
        for(int i=19;i>=0;i--)
            if(lev[u]-lev[v]>=(1<<i))
                u=spa[u][i];
        if(u==v)
            return u;
        for(int i=19;i>=0;i--)
            if(spa[u][i]!=spa[v][i])
            {
                u=spa[u][i];
                v=spa[v][i];
            }
        return spa[u][0];

    }
    static void dfs(Graph g,int src,int par)
    {
        spa[src][0]=par;
        sub[src]++;
        for(int i=1;i<20;i++)
            spa[src][i]=spa[spa[src][i-1]][i-1];
        for(Integer v:g.adj[src])
        {
            if(v!=par)
            {
                lev[v]=lev[src]+1;
                dfs(g,v,src);
                sub[src]+=sub[v];
            }
        }

    }
    static class Graph
    {
        static ArrayList<Integer>adj[];
        boolean vis[];
        Graph(int n)
        {
            adj=new ArrayList[n+1];
            vis=new boolean[n+1];
            for(int i=0;i<n+1;i++)
                adj[i]=new ArrayList<>();
        }
        static void addEdge(int u,int v)
               {adj[u].add(v);adj[v].add(u);}
        static void addDirEdge(int u,int v)
            {adj[u].add(v);}
    }
    
    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}
        else{sc=new AnotherReader(100);out=new PrintWriter("output.txt");}
        int t=1;
    //    t=ni();
        while(t-->0) {process();}
        out.flush();out.close();  
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}

/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.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()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
   
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}