PROGRAMMING:The story of happy town( Simple)
In a far away place, there is a happy town!
The public security of happy town is very bad, so it's not happy to live in the town!
The new security team leader Xiao Z is determined to change all this, the first step is to solve the problem of the distance between any two towns!
We need a simplified version of this problem:
Happy town can be divided into n small towns, numbered from 1 to n! These small towns are connected by n-1 roads. We simplify the length of each road to 1! As long as we send more people to each small town, we can make the security situation of the town better and better( There is only one road between the two towns
Every time small Z will ask you the number of two small towns, please calculate the shortest path length between the two towns!
###Input format:
The first line contains a positive integer (n < = 1000), indicating the number of small towns!
Next, n-1 lines, each line contains two integers between 1 and N, indicating that there is a road between the two numbered small towns!
The next line contains an integer Q (Q < = 100), indicating the number of queries!
Next, line Q, each line contains the number of two small towns, please output the shortest path length of these two small towns in one line!
###Output format:
Output the answer!
###Input example:
Here is a set of inputs. For example:
```in
ten
1 2
2 3
1 4
4 5
4 6
3 7
3 8
1 9
9 10
five
3 8
9 3
1 1
1 7
1 9
```
###Output example:
The corresponding output is given here. For example:
```out
one
three
0
three
one
```
answer:If there is no answer, please comment
The public security of happy town is very bad, so it's not happy to live in the town!
The new security team leader Xiao Z is determined to change all this, the first step is to solve the problem of the distance between any two towns!
We need a simplified version of this problem:
Happy town can be divided into n small towns, numbered from 1 to n! These small towns are connected by n-1 roads. We simplify the length of each road to 1! As long as we send more people to each small town, we can make the security situation of the town better and better( There is only one road between the two towns
Every time small Z will ask you the number of two small towns, please calculate the shortest path length between the two towns!
###Input format:
The first line contains a positive integer (n < = 1000), indicating the number of small towns!
Next, n-1 lines, each line contains two integers between 1 and N, indicating that there is a road between the two numbered small towns!
The next line contains an integer Q (Q < = 100), indicating the number of queries!
Next, line Q, each line contains the number of two small towns, please output the shortest path length of these two small towns in one line!
###Output format:
Output the answer!
###Input example:
Here is a set of inputs. For example:
```in
ten
1 2
2 3
1 4
4 5
4 6
3 7
3 8
1 9
9 10
five
3 8
9 3
1 1
1 7
1 9
```
###Output example:
The corresponding output is given here. For example:
```out
one
three
0
three
one
```
answer:If there is no answer, please comment