Mojtaba has two trees, each of them has vertices. Arpa has queries, each in type . Let be the set of vertices in the path from to in the first tree and be the set of vertices in the path from to in the second tree. Mojtaba has to calculate the size of for each query. Help him!
Input Format
The first line of input will contain two integers, ().
The next lines will contain edges of the first tree.
The next lines will contain edges of the second tree.
The next lines contain queries.
Output Format
For each query, let be the set of vertices in the path from to in the first tree and be the set of vertices in the path from to in the second tree, print the size of for each query.
The tree on the left is the first tree and the one in right is the second tree.
In the first query, , so the size of is 0.
In the third query, , so the answer is 3.