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.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;

public class E519 {

	static class Solver {

		int N, Q, logn;
		ArrayList<Integer>[] adj;
		int h[], par[][], size[];

		int dfs(int n, int p, int d) {
			size[n]++;
			h[n] = d;
			par[n][0] = p;
			for (int i = 1; par[n][i - 1] != -1; i++)
				par[n][i] = par[par[n][i - 1]][i - 1];
			for (int i : adj[n])
				if (i != p)
					size[n] += dfs(i, n, d + 1);
			return size[n];
		}

		int raise(int v, int d) {
			for (int p = 0; p < logn && p <= d; p++)
				if ((1 << p & d) > 0)
					v = par[v][p];
			return v;
		}

		int lca(int v1, int v2) {
			if (h[v1] > h[v2])
				return lca(v2, v1);
			int d = h[v2] - h[v1];
			v2 = raise(v2, d);
			if (v1 == v2)
				return v1;
			for (int p = logn - 1; p >= 0; p--)
				if (par[v1][p] != -1 && par[v2][p] != -1 && par[v1][p] != par[v2][p]) {
					v1 = par[v1][p];
					v2 = par[v2][p];
				}
			return par[v1][0];
		}

		int match(int v, int d) {
			return size[raise(v, d)] - size[raise(v, d - 1)];
		}

		int dmatch(int v1, int v2, int d) {
			return N - size[raise(v1, d - 1)] - size[raise(v2, d - 1)];
		}

		int query(int v1, int v2) {
			if (v1 == v2)
				return N;
			int v3 = lca(v1, v2);
			int d1 = h[v1] - h[v3], d2 = h[v2] - h[v3], d = d1 + d2 >> 1;
			if (2 * d != d1 + d2)
				return 0;
			if (h[v1] > h[v2])
				return match(v1, d);
			else if (h[v2] > h[v1])
				return match(v2, d);
			else
				return dmatch(v1, v2, d);
		}

		@SuppressWarnings("unchecked")
		void solve(JS s, PrintWriter out) {
			N = s.nextInt();
			logn = (int) Math.ceil(Math.log(N + 1) / Math.log(2)) + 1;
			adj = new ArrayList[N];
			h = new int[N];
			par = new int[N][logn];
			for (int[] a : par)
				Arrays.fill(a, -1);
			size = new int[N];

			for (int i = 0; i < N; i++)
				adj[i] = new ArrayList<>();
			for (int i = 1; i < N; i++) {
				int u = s.nextInt() - 1, v = s.nextInt() - 1;
				adj[u].add(v);
				adj[v].add(u);
			}

			dfs(0, -1, 0);

			Q = s.nextInt();
			for (int q = 0; q < Q; q++)
				out.println(query(s.nextInt() - 1, s.nextInt() - 1));

		}

	}

	public static void main(String[] args) {

		JS s = new JS();
		PrintWriter out = new PrintWriter(System.out);

		Solver solver = new Solver();
		solver.solve(s, out);

		out.close();

	}

	static int swap(int a, int b) {
		return a;
	}

	static Object swap(Object a, Object b) {
		return a;
	}

	static String ts(Object... o) {
		return Arrays.deepToString(o);
	}

	static class JS {
		public int BS = 1 << 16;
		public char NC = (char) 0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public JS() {
			in = new BufferedInputStream(System.in, BS);
		}

		public JS(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar() {
			while (bId == size) {
				try {
					size = in.read(buf);
				} catch (Exception e) {
					return NC;
				}
				if (size == -1)
					return NC;
				bId = 0;
			}
			return (char) buf[bId++];
		}

		public int nextInt() {
			return (int) nextLong();
		}

		public long nextLong() {
			num = 1;
			boolean neg = false;
			if (c == NC)
				c = nextChar();
			for (; (c < '0' || c > '9'); c = nextChar()) {
				if (c == '-')
					neg = true;
			}
			long res = 0;
			for (; c >= '0' && c <= '9'; c = nextChar()) {
				res = (res << 3) + (res << 1) + c - '0';
				num *= 10;
			}
			return neg ? -res : res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c != '.' ? cur : cur + nextLong() / num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while (c <= 32)
				c = nextChar();
			while (c > 32) {
				res.append(c);
				c = nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while (c <= 32)
				c = nextChar();
			while (c != '\n') {
				res.append(c);
				c = nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if (c > 32)
				return true;
			while (true) {
				c = nextChar();
				if (c == NC)
					return false;
				else if (c > 32)
					return true;
			}
		}

	}
}