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.
/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.util.*;

public class Codeforces429A
{
	
	InputStream in;
	PrintWriter out;
	
	ArrayList<Integer> g[];
	void solve() 
	{
		int n=ni();
		g=new ArrayList[n];
		for (int i=0;i<n;i++)
			g[i]=new ArrayList<>();
		
		for (int i=0;i<n-1;i++)
		{
			int u=ni()-1;
			int v=ni()-1;
			g[u].add(v);
			g[v].add(u);
		}
		preprocess(n, 0);
		int m=ni();
		while (m-->0)
		{
			int u=ni()-1;
			int v=ni()-1;
			if (u==v)
			{
				out.println(n);
				continue;
			}
			tr(u+" "+v);
			int dis=distance(u, v);
			int lca=lca(u,v);
			int d1=depth[u]-depth[lca];
			int d2=depth[v]-depth[lca];
			if (dis%2==0)
			{
				if (d1==d2)
				{
					tr("1");
					int a1=getAncestor(u,dis/2-1);
					int a2=getAncestor(v,dis/2-1);
					out.println(n-size[a1]-size[a2]);
				}
				else if (d1<d2)
				{
					tr("2");
					int a1=getAncestor(v,dis/2);
					int a2=getAncestor(v,dis/2-1);
					out.println(size[a1]-size[a2]);
				}
				else
				{
					tr("3");
					int a1=getAncestor(u,dis/2);
					int a2=getAncestor(u,dis/2-1);
					out.println(size[a1]-size[a2]);
				}
			}
			else
				out.println(0);
		}
	}
	
	
	int len;
	int[][] up;
	int[] tin;
	int[] tout;
	int time;
	int[] depth;
	int[] size;
	void dfs(int u, int p, int level) {
		depth[u] = level;
		tin[u] = time++;
		up[0][u] = p;
		for (int i = 1; i < len; i++)
			up[i][u] = up[i - 1][up[i - 1][u]];
		for (int v : g[u])
			if (v != p)
			{
				dfs(v, u, level + 1);
				size[u]+=size[v];
			}
		tout[u] = time++;
		size[u]++;
	}
	
	int getAncestor(int u,int k)
	{
		for (int i=len-1;i>=0;i--)
		{
			if (k>=(1<<i))
			{
				k-=(1<<i);
				u=up[i][u];
			}
		}
		return u;
	}

	boolean isParent(int parent, int child) {
		return tin[parent] <= tin[child] && tout[child] <= tout[parent];
	}

	int lca(int a, int b) {
		if (isParent(a, b))
			return a;
		if (isParent(b, a))
			return b;
		for (int i = len - 1; i >= 0; i--)
			if (!isParent(up[i][a], b))
				a = up[i][a];
		return up[0][a];
	}

	void preprocess(int n, int root) {

		len = 1;
		while ((1 << len) <= n)
			++len;
		up = new int[len][n];
		tin = new int[n];
		tout = new int[n];
		depth = new int[n];
		size = new int[n];
		dfs(root, root, 0);
	}

	int distance(int a, int b) {
		return depth[a] + depth[b] - 2 * depth[lca(a, b)];
	}
	
	
	void run() throws Exception 
	{
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");
		
	}
	public static void main(String[] args) throws Exception 
	{
		new Codeforces429A().run();
	}
	
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte() 
	{
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) 
		{
			ptrbuf = 0;
			try 
			{
				lenbuf = in.read(inbuf);
			}
			catch (IOException e) 
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean inSpaceChar(int c) 
	{
		return !(c >= 33 && c <= 126);
	}
	
	private int skip() 
	{
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}
	
	private double nd() 
	{
		return Double.parseDouble(ns());
	}
	
	private char nc() 
	{
		return (char) skip();
	}
	
	private String ns() 
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b))) 
		{ // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n) 
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b))) 
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m) 
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n) 
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	
	private int ni() 
	{
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') 
		{
			minus = true;
			b = readByte();
		}
		
		while (true) 
		{
			if (b >= '0' && b <= '9') 
			{
				num = num * 10 + (b - '0');
			} 
			else 
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private long nl() 
	{
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') 
		{
			minus = true;
			b = readByte();
		}
		
		while (true) 
		{
			if (b >= '0' && b <= '9') 
			{
				num = num * 10 + (b - '0');
			}
			else 
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	
	private void tr(Object... o) 
	{
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}
	
}