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 com.MahmoudHamdy;

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class Main {

    static final int INF = (int) 2e9;
    static final int N = (int) 1e5 + 100;

    static ArrayList<ArrayList<Integer>> vec;
    static int[] sparse[], par, lv, sz;
    static int n;

    public static void main(String[] args) throws IOException {
//        Scanner Sc = new Scanner("input.txt");
//        PrintWriter Out = new PrintWriter(new FileWriter("output.txt"));
        Scanner Sc = new Scanner(System.in);
        PrintWriter Out = new PrintWriter(System.out);

        vec = new ArrayList<>();
        sparse = new int[N][22];
        par = new int[N];
        lv = new int[N];
        sz = new int[N];
        for(int i = 0; i < N; i++)
        {
            vec.add(new ArrayList<>());
            par[i] = -1;
            for(int j = 0; j < 22; j++)
                sparse[i][j] = -1;
        }
        n = Sc.nextInt();
        for(int i = 0; i < n - 1; i++)
        {
            int a = Sc.nextInt() - 1, b = Sc.nextInt() - 1;
            vec.get(a).add(b);
            vec.get(b).add(a);
        }
        dfs(0, -1, 0);
        build();
        int q = Sc.nextInt();
        while(q-- > 0)
        {
            int a = Sc.nextInt() - 1, b = Sc.nextInt() - 1;
            int lca = lca(a, b);
            int d = dis(a, lca) + dis(b, lca);
            if(a == b)
                Out.println(n);
            else if(d % 2 != 0)
                Out.println(0);
            else{
                if(dis(a, lca) == dis(b, lca))
                {
                    int x = lvl(a, dis(a, lca) - 1);
                    int y = lvl(b, dis(b, lca) - 1);
                    Out.println(n - sz[x] - sz[y]);
                }else
                {
                    if(lv[a] < lv[b])
                    {
                        int t = a;
                        a = b;
                        b = t;
                    }
                    d /= 2;
                    b = a;
                    a = lvl(a, d);
                    b = lvl(b, d - 1);
                    Out.println(sz[a] - sz[b]);
                }
            }
        }

        Out.flush();
        Out.close();
    }

    static int dfs(int v, int p, int l)
    {
        lv[v] = l;
        par[v] = p;
        sparse[v][0] = p;
//        System.out.println(v + " " + p + " " + sparse[v][0]);
        sz[v] = 1;
        for(int i : vec.get(v))
            if(i != p)
                sz[v] += dfs(i, v, l + 1);
        return sz[v];
    }

    static void build()
    {
        for(int j = 1; j < 22; j++)
            for(int i = 0; i < n; i++)
                if(sparse[i][j - 1] != -1)
                    sparse[i][j] = sparse[sparse[i][j - 1]][j - 1];
    }

    static int dis(int u, int v)
    {
        return lv[u] - lv[v];
    }

    static int lca(int u, int v)
    {
        if(lv[u] < lv[v])
        {
            int t = u;
            u = v;
            v = t;
        }
        int d = dis(u, v);
        while(d > 0)
        {
            int r = (int)(Math.log(d) / Math.log(2) + 1e-9);
//            System.out.print(u + " " + v + " " + d + " " + r);
            u = sparse[u][r];
            d -= (1 << r);
        }
        if(u == v)
            return u;
        for(int j = 21; j >= 0; j--)
            if(sparse[u][j] != -1 && sparse[u][j] != sparse[v][j])
            {
                u = sparse[u][j];
                v = sparse[v][j];
            }
        return par[u];
    }

    static int lvl(int u, int l)
    {
        for(int i = 21; i >= 0; i--)
            if(u > 0 && l - (1 << i) >= 0)
            {
                u = sparse[u][i];
                l -= (1 << i);
            }
        return u;
    }

    static class Comp
    {
        TreeMap<Integer, Integer> mop = new TreeMap<>();
        TreeSet<Integer> st = new TreeSet<>();

        void add(int x)
        {
            st.add(x);
        }
        int get(int x)
        {
            return mop.get(x);
        }
        void compress()
        {
            for(int i : st)
                mop.put(i, mop.size());
        }
    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }
        Scanner(String s) throws FileNotFoundException { br = new BufferedReader(new FileReader(s)); }


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

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

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

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

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }

    }

    static class pair implements Comparable<pair>{
        char f;long s;
        pair(char a,long b){f= a;s=b;}

        @Override
        public int compareTo(pair p) {
            if(s != p.s)
                return s > p.s ? 1 : -1;
            return f-p.f;
        }
    }
}