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.*;
import java.util.*;
import java.math.*;

public final class lecture_room
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	static Random rnd=new Random();
	static int[][] al;
	static int[] cnt;
	static int[][] st;
	static int[] tin,tout;
	static int time=0;
	static List<Pair> list=new ArrayList<>();
	static int LN=21;
	static int[] level,size;
	static int n;
	
	static void dfs(int u,int p,int l)
	{
		tin[u]=++time;st[0][u]=p;level[u]=l;
		
		size[u]=1;
		
		for(int x:al[u])
		{
			if(x!=p)
			{
				dfs(x,u,l+1);
				
				size[u]+=size[x];
			}
		}
		
		tout[u]=time;
	}
	
	static int lca(int u,int v)
	{
		if(isAncestor(u,v)) return u;
		
		if(isAncestor(v,u)) return v;
		
		for(int i=LN-1;i>=0;i--)
		{
			if(!isAncestor(st[i][u],v))
			{
				u=st[i][u];
			}
		}
		
		return st[0][u];
	}
	
	static boolean isAncestor(int u,int v)
	{
		return tin[u]<=tin[v] && tout[u]>=tout[v];
	}
	
	static int dis(int u,int v)
	{
		return (level[u]+level[v]-(2*level[lca(u,v)]));
	}
	
	static int get(int u,int v)
	{
		int dis=dis(u,v);
		
		if(dis%2!=0) return 0;
		
		if(isAncestor(v,u))
		{
			return get1(u,v,dis);
		}
		
		return get2(u,v,dis);
	}
	
	static int getK(int u,int k)
	{
		for(int i=LN-1;i>=0;i--)
		{
			int curr=(1<<i);
			
			if(k>=curr)
			{
				k-=curr;u=st[i][u];
			}
		}
		
		return u;
	}
	
	static int get1(int u,int v,int dis)
	{
		int curr=getK(u,(dis/2)-1);
		
		return size[st[0][curr]]-size[curr];
	}
	
	static int get2(int u,int v,int dis)
	{
		int curr=getK(u,dis/2);
		
		if(isAncestor(curr,u) && isAncestor(curr,v))
		{
			return n-size[getK(u,(dis/2)-1)]-size[getK(v,(dis/2)-1)];
		}
		
		else
		{
			return size[curr]-size[getK(u,(dis/2)-1)];
		}
	}
	
    public static void main(String args[]) throws Exception
    {
		n=sc.nextInt();cnt=new int[n];
		
		for(int i=1;i<n;i++)
		{
			int u=sc.nextInt()-1,v=sc.nextInt()-1;
			
			list.add(new Pair(u,v));cnt[u]++;cnt[v]++;
		}
		
		al=new int[n][];
		
		for(int i=0;i<n;i++)
		{
			al[i]=new int[cnt[i]];cnt[i]=0;
		}
		
		for(int i=0;i<list.size();i++)
		{
			int u=list.get(i).u,v=list.get(i).v;
			
			al[u][cnt[u]++]=v;al[v][cnt[v]++]=u;
		}
		
		tin=new int[n];tout=new int[n];st=new int[LN][n];level=new int[n];size=new int[n];dfs(0,0,1);
		
		for(int i=1;i<LN;i++)
		{
			for(int j=0;j<n;j++)
			{
				st[i][j]=st[i-1][st[i-1][j]];
			}
		}
		
		int q=sc.nextInt();
		
		while(q>0)
		{
			int x=sc.nextInt()-1,y=sc.nextInt()-1;
			
			int u=level[x]>=level[y]?x:y,v=level[x]>=level[y]?y:x;
			
			out.println(u!=v?get(u,v):n);
			
			q--;
		}
		
		out.close();
    }
}

class Pair
{
	int u,v;
	
	public Pair(int u,int v)
	{
		this.u=u;this.v=v;
	}
}

class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }
	
    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
	
	public String next() throws Exception {
		return nextToken().toString();
	}
	
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}