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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution{
	
	static int n;
	static ArrayList<Integer>[] g;
	static int[][] par;
	static int[] dep;
	static int[] num;
	
	
    public static void main(String[] args) throws IOException {
    	
		
    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    		
    	int tt = 1;
    	while(tt-->0) {
    		
    		n = fs.nextInt();
    		
    		g = new ArrayList[n];
    		for(int i=0;i<n;i++) g[i] = new ArrayList<Integer>();
    		
    		
    		for(int i=0;i<n-1;i++) {
    			int u = fs.nextInt()-1, v = fs.nextInt()-1;
    			g[u].add(v);
    			g[v].add(u);
    		}
    		
    		par = new int[n][20];
    		dep = new int[n];
    		dep[0] = 0;
    		
    		dfs(0, -1);
    		
    		num = new int[n];
    		dfs2(0, -1);
    		
    		int[] DEP = dep;
    		int[][] PAR = par;
    		int[] NUM = num;
    		
    		
    		int m = fs.nextInt();
    		
    		while(m-->0) {
    			
    			int u = fs.nextInt()-1, v = fs.nextInt()-1;
    			if(u==v) {
    				out.println(n);
    				continue;
    			}
    			if(dep[u]<dep[v]) {
    				int temp = u; u = v; v = temp;
    			}
    			
    			int d = dist(u, v);
    			if(d%2!=0) {
    				out.println(0);
    				continue;
    			}
    			
    			int p2 = findpar(u, d/2-1);
    			int p1 = par[p2][0];
    			
    			if(dep[u]==dep[v]) {
    				int p3 = findpar(v, d/2-1);
    				int ans = (n-num[p2]-num[p3]);
    				out.println(ans);
    			}
    			else {
    				int ans = (num[p1]-num[p2]);
    				out.println(ans);
    			}
    			
    			
    			
    			
    		}
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    		
    	}
    	
    	out.close();
    		
    	
    	
    }
    
    
    static void dfs(int v, int p) {
    	par[v][0] = p;
    	for(int i=1;i<20;i++) {
    		if(par[v][i-1]==-1) par[v][i] = -1;
    		else par[v][i] = par[par[v][i-1]][i-1];
    	}
    	for(int u: g[v]) {
    		if(u==p) continue;
    		dep[u] = 1 + dep[v];
    		dfs(u, v);
    	}
    }
    
    
    static void dfs2(int v,int p) {
    	num[v] = 1;
    	for(int u: g[v]) {
    		if(u==p) continue;
    		dfs2(u, v);
    		num[v] += num[u];
    	}
    }
    
    
    
    static int lca(int a,int b) {
    	if(dep[a]>dep[b]) {
    		int temp = a; a = b; b = temp;
    	}
    	int dif = dep[b]-dep[a];
    	for(int i=0;i<20;i++) {
    		if((dif&(1<<i))!=0) {
    			b = par[b][i];
    		}
    	}
    	
    	if(a==b) return a;
    	
    	for(int i=19;i>=0;i--) {
    		if(par[a][i]!=par[b][i]) {
    			a = par[a][i]; b = par[b][i];
    		}
    	}
    	return par[a][0];
    }
    
    
    
    static int dist(int a,int b) {
    	return dep[a]+dep[b]-2*dep[lca(a, b)];
    }
    
    static int findpar(int v, int k) {
    	for(int i=0;i<20;i++) {
    		if((k&(1<<i))!=0) {
    			v = par[v][i];
    		}
    	}
    	return v;
    }
    
    
   
    
    
    
    static final Random random=new Random();
    
    static <T> void shuffle(T[] arr) {
    	int n = arr.length;
    	for(int i=0;i<n;i++	) {
    		int k = random.nextInt(n);
    		T temp = arr[k]; arr[k] = arr[i]; arr[i] = temp;
    	}
    }
    
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
    
    static void ruffleSort(long[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); long temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    static void reverse(int[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		int temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    static void reverse(long[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++){
    		long temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    
    
    static <T> void reverse(T[] arr, int l, int r) {
    	for(int i=l;i<l+(r-l)/2;i++) {
    		T temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp;
    	}
    }
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }
   	
}
