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.BufferedWriter;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Collections;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.Comparator;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nguyen Trung Hieu - vuondenthanhcong11@gmail.com
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskE {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int count = in.readInt();
        int[] from = new int[count - 1];
        int[] to = new int[count - 1];
        IOUtils.readIntArrays(in, from, to);
        MiscUtils.decreaseByOne(from, to);
        int[][] graph = GraphUtils.buildSimpleGraph(count, from, to);
        LCA lca = new LCA(graph);

        int[] subTree = new int[count];
        dfs(0, -1, graph, subTree);

        int queryCount = in.readInt();
        for (int query = 0; query < queryCount; query++) {
            int first = in.readInt() - 1;
            int second = in.readInt() - 1;
            int ancestor = lca.getLCA(first, second);
            int dist = lca.getPathLength(first, second);
            if (dist % 2 == 1) {
                out.printLine(0);
            } else if (first == second) {
                out.printLine(count);
            } else if (lca.getPathLength(first, ancestor) == lca.getPathLength(second, ancestor)) {
                int a = lca.goUp(first, ancestor);
                int b = lca.goUp(second, ancestor);
                out.printLine(count - subTree[a] - subTree[b]);
            } else {
                dist /= 2;
                if (lca.getLevel(first) < lca.getLevel(second)) {
                    int tmp = first;
                    first = second;
                    second = tmp;
                }
                first = lca.getAncestor(first, dist - 1);
                int mid = lca.getAncestorAt(first, 0);
                out.printLine(subTree[mid] - subTree[first]);
            }
        }
    }

    private void dfs(int cur, int from, int[][] graph, int[] subTree) {
        subTree[cur] = 1;
        for (int next : graph[cur]) {
            if (next == from) {
                continue;
            }
            dfs(next, cur, graph, subTree);
            subTree[cur] += subTree[next];
        }
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }

}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}

class IOUtils {

    public static void readIntArrays(InputReader in, int[]... arrays) {
        for (int i = 0; i < arrays[0].length; i++) {
            for (int j = 0; j < arrays.length; j++)
                arrays[j][i] = in.readInt();
        }
    }

}

class MiscUtils {

    public static void decreaseByOne(int[]...arrays) {
        for (int[] array : arrays) {
            for (int i = 0; i < array.length; i++)
                array[i]--;
        }
    }

}

class GraphUtils {
    public static int[][] buildGraph(int vertexCount, int[] from, int[] to) {
        int edgeCount = from.length;
        int[] degree = new int[vertexCount];
        for (int i = 0; i < edgeCount; i++) {
            degree[from[i]]++;
            degree[to[i]]++;
        }
        int[][] graph = new int[vertexCount][];
        for (int i = 0; i < vertexCount; i++)
            graph[i] = new int[degree[i]];
        for (int i = 0; i < edgeCount; i++) {
            graph[from[i]][--degree[from[i]]] = i;
            graph[to[i]][--degree[to[i]]] = i;
        }
        return graph;
    }

    public static int otherVertex(int vertex, int from, int to) {
        return from + to - vertex;
    }

    public static int[][] buildSimpleGraph(int vertexCount, int[] from, int[] to) {
        int[][] graph = buildGraph(vertexCount, from, to);
        simplifyGraph(from, to, graph);
        return graph;
    }

    private static void simplifyGraph(int[] from, int[] to, int[][] graph) {
        for (int i = 0; i < graph.length; i++) {
            for (int j = 0; j < graph[i].length; j++) {
                graph[i][j] = otherVertex(i, from[graph[i][j]], to[graph[i][j]]);
            }
        }
    }

}

class LCA {
    private int len;
    private int timer = 0;

    private final int[][] graph;
    private final int[] level;
    private final int[][] ancestor;
    private final int[] timeIn;
    private final int[] timeOut;

    public LCA(int[][] graph) {
        this(graph, 0);
    }

    public LCA(int[][] graph, int root) {
        int graphSize = graph.length;
        len = Integer.numberOfTrailingZeros(Integer.highestOneBit(graphSize - 1)) + 1;

        this.graph = graph;
        level = new int[graphSize];
        ancestor = new int[graphSize][len];
        timeIn = new int[graphSize];
        timeOut = new int[graphSize];

        init(root, root, 0);
    }

    private void init(int cur, int from, int deep) {
        level[cur] = deep;
        timeIn[cur] = timer++;

        ancestor[cur][0] = from;
        for (int i = 1; i < len; i++) {
            ancestor[cur][i] = ancestor[ancestor[cur][i - 1]][i - 1];
        }

        for (int next : graph[cur]) {
            if (next == from) {
                continue;
            }
            init(next, cur, deep + 1);
        }

        timeOut[cur] = timer++;
    }

    private boolean isAncestor(int first, int second) {
        return timeIn[first] <= timeIn[second] && timeOut[second] <= timeOut[first];
    }

    public int goUp(int first, int second) {
        for (int i = len - 1; i >= 0; i--) {
            if (!isAncestor(ancestor[first][i], second)) {
                first = ancestor[first][i];
            }
        }
        return first;
    }

    public int getLCA(int first, int second) {
        int answer = -1;
        if (isAncestor(first, second)) {
            answer = first;
        } else if (isAncestor(second, first)) {
            answer = second;
        } else {
            answer = ancestor[goUp(first, second)][0];
        }
        return answer;
    }

    public int getPathLength(int first, int second) {
        return level[first] + level[second] - 2 * level[getLCA(first, second)];
    }

    public int getAncestor(int vertex, int dist) {
        if (dist == 0) {
            return vertex;
        }
        int curVertex = vertex;
        for (int i = len - 1; i >= 0; i--) {
            if (level[curVertex] - level[ancestor[vertex][i]] < dist) {
                vertex = ancestor[vertex][i];
            }
        }

        return ancestor[vertex][0];
    }

    public int getAncestorAt(int vertex, int idx) {
        return ancestor[vertex][idx];
    }

    public int getLevel(int vertex) {
        return level[vertex];
    }
}

