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 Div2;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
import java.util.Stack;

public class Sketch {
	public static class Graph {
		private int n;
		private int[] lasts;
		
		private static class Edge {
			public int prev;
			public int next;
			public Edge(int p, int n){
				prev = p; next = n;
			}
		}
		private int endEdge;
		private Edge[] edges;

		private int[] subsizes;
		private int[] heights;
		private int[][] jumps;
		private int[][] rmq;
		private int[] orders;
		
		public void init(){
			int[] stack = new int[n];
			dfs(0, -1, stack, 0);
			
			List<Integer> list = new ArrayList<Integer>();
			findOrder(0, -1, list);
			
			int endOrder = 0;
			int[] order = new int[list.size()];
			boolean[] visited = new boolean[n];
			for(Integer iter : list){
				if(!visited[iter]){
					visited[iter] = true;
					orders[iter] = endOrder;
				}
				order[endOrder++] = iter;
			}
			
			rmq = new int[list.size()][20];
			
			int pow = 1;
			for(int i=0; i<rmq.length; i++) rmq[i][0] = order[i];
			for(int j=1; j<20; j++){
				for(int i=0; i<rmq.length-pow; i++){
					rmq[i][j] = heights[rmq[i][j-1]] < heights[rmq[i+pow][j-1]]? rmq[i][j-1] : rmq[i+pow][j-1];
				}
				pow = pow << 1;
			}
		}

		private void findOrder(int cur, int prnt, List<Integer> list){
			list.add(cur);
			for(int e=lasts[cur]; e!=-1; e=edges[e].prev){
				int nxt = edges[e].next;
				if(nxt != prnt){
					findOrder(nxt, cur, list);
					list.add(cur);
				}
			}
		}
		
		private void dfs(int cur, int prnt, int[] stack, int endStack){
			subsizes[cur] = 1;
			stack[endStack++] = cur;
			int pow = 1;
			int idx = 0;
			while(pow <= endStack-1){
				jumps[cur][idx] = stack[endStack-1-pow];
				idx++; pow = pow << 1;
			}
			for(int e=lasts[cur]; e!=-1; e=edges[e].prev){
				int nxt = edges[e].next;
				if(nxt != prnt){
					heights[nxt] = heights[cur] + 1;
					dfs(nxt, cur, stack, endStack);
					subsizes[cur] += subsizes[nxt];
				}
			}
		}

		public Graph(int size){
			n = size;
			int logn = 0;
			int pow2 = 1;
			while(pow2 <= n){
				logn++; pow2 = pow2 << 1;
			}
			lasts = new int[size]; subsizes = new int[size]; jumps = new int[n][logn+1];
			// rmq = new int[n][logn]; 
			orders = new int[n];
			heights = new int[size];
			endEdge = 0;
			for(int i=0; i<n; i++) lasts[i] = -1;
			edges = new Edge[2*n];
		}
		
		public void addEdge(int u, int v){
			edges[endEdge] = new Edge(lasts[u], v);
			lasts[u] = endEdge++;
			edges[endEdge] = new Edge(lasts[v], u);
			lasts[v] = endEdge++;
		}
		
		public int query(int x, int y){
			if(x == y) return n;
			int l = Math.min(orders[x], orders[y]);
			int r = Math.max(orders[x], orders[y]);
			int pow = 1;
			int idx = 0;
			while(pow<<1 <= r - l){
				pow = pow << 1;
				idx++;
			}
			int lca = heights[rmq[l][idx]] < heights[rmq[r-pow+1][idx]]? rmq[l][idx] : rmq[r-pow+1][idx];
			int len = heights[x] + heights[y] - (heights[lca] << 1);
			if(len % 2 != 0) return 0;

			len = (len >> 1) - 1;

			if(heights[x] == heights[y]){
				int tmpLen = len; int curx = x; idx = 0;
				while(tmpLen > 0){
					if(tmpLen % 2 == 1) curx = jumps[curx][idx];
					tmpLen = tmpLen >> 1; idx++;
				}
				tmpLen = len; int cury = y; idx = 0;
				while(tmpLen > 0){
					if(tmpLen % 2 == 1) cury = jumps[cury][idx];
					tmpLen = tmpLen >> 1; idx++;
				}
				return n - subsizes[curx] - subsizes[cury];
			}
			
			int cur = heights[x]>heights[y]? x : y;
			idx = 0;
			while(len > 0){
				if(len % 2 == 1) cur = jumps[cur][idx];
				len = len >> 1; idx++;
			}
			return subsizes[jumps[cur][0]] - subsizes[cur];
		}
	}
	
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		Graph graph = new Graph(n);
		for(int i=0; i<n-1; i++){
			int u = input.nextInt()-1; int v = input.nextInt()-1;
			graph.addEdge(u, v);
		}
		graph.init();
		int m = input.nextInt();
		
		StringBuffer buf = new StringBuffer();
		for(int i=0; i<m; i++){
			int x = input.nextInt()-1; int y = input.nextInt()-1;
			int answer = graph.query(x, y);
			buf.append(answer + "\n");
		}
		input.close();
		System.out.println(buf.toString());
	}
}