Problem: New Year is coming in Tree Island! In this island, as the name implies, there are n cities connected by n - 1 roads, and for any two distinct cities there always exists exactly one path between them. For every person in Tree Island, it takes exactly one minute to pass by exactly one road.

There is a weird New Year tradition for runnners in Tree Island, which is called "extreme run". This tradition can be done as follows.

A runner chooses two distinct cities a and b. For simplicity, let's denote the shortest path from city a to city b as p1, p2, ..., pl (here, p1 = a and pl = b holds). Then following happens:

  1. The runner starts at city a. 
  2. The runner runs from city a to b, following the shortest path from city a to city b. 
  3. When the runner arrives at city b, he turns his direction immediately (it takes no time), and runs towards city a, following the shortest path from city b to city a. 
  4. When the runner arrives at city a, he turns his direction immediately (it takes no time), and runs towards city b, following the shortest path from city a to city b. 
  5. Repeat step 3 and step 4 forever. 



In short, the course of the runner can be denoted as: <image> <image>

Two runners JH and JY decided to run "extremely" in order to celebrate the New Year. JH has chosen two cities u and v, and JY has chosen two cities x and y. They decided to start running at the same moment, and run until they meet at the same city for the first time. Meeting on a road doesn't matter for them. Before running, they want to know the amount of time they will run.

It is too hard for JH and JY to calculate this, so they ask you for help.

Input

The first line contains a single positive integer n (5 ≤ n ≤ 2 × 105) — the number of cities in Tree Island.

Next n - 1 lines describe the roads of Tree Island. The i-th line (1 ≤ i ≤ n - 1) of them contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ n, ai ≠ bi) — the vertices connected by a single road of the tree.

The next line contains an integer t (1 ≤ t ≤ 2 × 105) — the number of test cases.

Next t lines describes the test cases. The j-th line (1 ≤ j ≤ t) of them contains four space-separated integers uj, vj, xj, yj (1 ≤ uj, vj, xj, yj ≤ n, uj ≠ vj, xj ≠ yj). It means that in this test case, JH has chosen two cities uj and vj, JY has chosen two cities xj and yj. JH starts running at city uj, and JY starts running at city xj.

Output

For each test case, print an integer describing the amount of time they should run in minutes. If they have to run for an infinitely long time (in other words, if they never meet at the same city), print -1 instead. If they meet at the beginning of their run, print 0.

Examples

Input

7
1 3
3 6
7 4
3 7
5 4
7 2
4
6 5 5 3
3 5 4 6
1 5 1 3
1 5 3 1


Output

2
1
0
-1

Note

The example looks like:

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int Inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const int maxn = 200005;
int N;
vector<int> nei[maxn];
int Fa[20][maxn], *fa = Fa[0];
int dep[maxn];
void dfs(int now, int lst) {
  fa[now] = lst;
  for (int i = 1; i <= (19); ++i) Fa[i][now] = Fa[i - 1][Fa[i - 1][now]];
  dep[now] = dep[lst] + 1;
  for (auto &to : (nei[now]))
    if (to != lst) dfs(to, now);
}
int inline lca(int a, int b) {
  if (dep[a] < dep[b]) swap(a, b);
  int toup = dep[a] - dep[b];
  for (int i = 0; i < (20); ++i)
    if ((toup >> i) & 1) a = Fa[i][a];
  if (a == b) return a;
  for (int i = (19); (-1) > 0 ? i <= (0) : i >= (0); i += (-1))
    if (Fa[i][a] != Fa[i][b]) a = Fa[i][a], b = Fa[i][b];
  return fa[a];
}
int inline dist(int a, int b) { return dep[a] + dep[b] - dep[lca(a, b)] * 2; }
long long inline gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void inline exgcd(long long a, long long b, long long &x, long long &y) {
  b ? (exgcd(b, a % b, y, x), y -= a / b * x) : (x = 1, y = 0);
}
long long inline calc_cachup(long long d1, long long d2, long long t1,
                             long long t2) {
  long long c = t2 - t1, g = gcd(d1, d2);
  if (c % g) return INF;
  long long x, y;
  exgcd(d1, d2, x, y);
  y = -y;
  x *= c / g;
  y *= c / g;
  d1 /= g;
  d2 /= g;
  if (x < 0 || y < 0) {
    int jar = max((-x - 1) / d2 + 1, (-y - 1) / d1 + 1);
    x += jar * d2;
    y += jar * d1;
  }
  int jan = max(x / d2, y / d1);
  x -= jan * d2;
  y -= jan * d1;
  return x * g * d1 + t1;
}
long long inline euclid(int a, int b, int l, int r) {
  if (l > r || !b) return INF;
  if ((l - 1) / b != r / b) return (l + b - 1) / b;
  long long res = euclid(b, a % b, (b - r % b) % b, (b - l % b) % b);
  if (res == INF) return INF;
  return (res * a + l + b - 1) / b;
}
long long inline calc_meet(long long d1, long long d2, long long t1,
                           long long t2, long long dis) {
  if ((t1 + t2 + dis) % 2) return INF;
  long long L = ((t2 - t1 - dis) % d2 + d2) % d2,
            R = ((t2 - t1 + dis) % d2 + d2) % d2;
  long long x = (!L || L > R || 2 * dis == d2) ? 0 : euclid(d2, d1 % d2, L, R);
  if (x == INF) return INF;
  long long y = (x * d1 - (t2 - t1 - dis)) / d2;
  return (x * d1 + y * d2 + t1 + t2 + dis) / 2;
}
long long solve(int a, int b, int x, int y) {
  vector<int> lcas = {lca(a, x), lca(a, y), lca(b, x), lca(b, y)};
  sort((lcas).begin(), (lcas).end(),
       [&](int a, int b) { return dep[a] > dep[b]; });
  int l1 = lcas[0], l2 = lcas[1];
  if (l1 == l2 && dep[l1] < max(dep[lca(a, b)], dep[lca(x, y)])) return INF;
  long long d1 = dist(a, b) * 2, d2 = dist(x, y) * 2, d = dist(l1, l2);
  long long ad1 = dist(a, l1), ad2 = dist(a, l2);
  if (ad1 > ad2)
    ad1 = d1 - ad1;
  else
    ad2 = d1 - ad2;
  long long xd1 = dist(x, l1), xd2 = dist(x, l2);
  if (xd1 > xd2)
    xd1 = d2 - xd1;
  else
    xd2 = d2 - xd2;
  return min({calc_cachup(d1, d2, ad1, xd1), calc_cachup(d1, d2, ad2, xd2),
              calc_meet(d1, d2, ad1, xd2, d), calc_meet(d1, d2, ad2, xd1, d)});
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= (N - 1); ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    nei[u].push_back(v);
    nei[v].push_back(u);
  }
  dfs(1, 0);
  int q;
  scanf("%d", &q);
  while (q--) {
    int a, b, x, y;
    scanf("%d%d%d%d", &a, &b, &x, &y);
    long long res = solve(a, b, x, y);
    printf("%lld\n", res == INF ? -1 : res);
  }
  return 0;
}