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;
struct apple {
  long long v, nxt;
} edge[200011 * 4];
long long indexx[200011], tot, fa[200011][20 + 1], deep[200011], n, m, ans;
void addedge(long long x, long long y) {
  edge[++tot].v = y;
  edge[tot].nxt = indexx[x];
  indexx[x] = tot;
}
void basic_dfs(long long u, long long Fa, long long dep) {
  deep[u] = dep;
  fa[u][0] = Fa;
  long long t = indexx[u], vv;
  while (t) {
    vv = edge[t].v;
    if (vv != Fa) {
      basic_dfs(vv, u, dep + 1);
    }
    t = edge[t].nxt;
  }
}
long long lca(long long x, long long y) {
  if (deep[x] < deep[y]) swap(x, y);
  for (long long i = 20; i >= 0; i--) {
    if (deep[fa[x][i]] >= deep[y]) x = fa[x][i];
  }
  if (x == y) return x;
  long long ret = 0;
  for (long long i = 20; i >= 0; i--) {
    if (fa[x][i] == fa[y][i])
      ret = fa[x][i];
    else
      x = fa[x][i], y = fa[y][i];
  }
  return ret;
}
long long Dist(long long x, long long y) {
  long long f = lca(x, y);
  return deep[x] + deep[y] - deep[f] * 2;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
    return;
  }
  exgcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - (a / b) * y;
}
long long work(long long L, long long R, long long D, long long M) {
  D %= M;
  if (L == 0) return 0;
  if (D + D > M) L = M - L, R = M - R, D = M - D, swap(L, R);
  if ((L - 1) / D < R / D) return (L - 1 + D) / D;
  long long t = work(L % D, R % D, D - M % D, D);
  return (L - 1 + t * M + D) / D;
}
long long solve1(long long t1, long long L1, long long t2, long long L2) {
  if (t1 > t2) swap(t1, t2), swap(L1, L2);
  long long t = t2 - t1;
  long long g = gcd(L1, L2);
  if (t % g) return 0x7f7f7f7f7f7f;
  L1 /= g, L2 /= g, t /= g;
  long long x, y;
  exgcd(L1, L2, x, y);
  x = (x % L2 + L2) % L2;
  x = x * t % L2;
  return t1 + L1 * x * g;
}
long long solve2(long long L1, long long L2, long long t1, long long t4,
                 long long d) {
  if (L1 > L2) swap(L1, L2), swap(t1, t4);
  long long l = (t4 - t1 - d + L2 + L2) % L2;
  long long r = (t4 - t1 + d + L2) % L2, t = 0;
  if (l & 1) return 0x7f7f7f7f7f7f;
  if (L2 != d + d && l <= r && l) {
    if ((l - 1) / gcd(L1, L2) >= r / gcd(L1, L2)) return 0x7f7f7f7f7f7f;
    t = work(l, r, L1, L2);
  }
  long long s = (t * L1 + t1 + d - t4) / L2;
  return (d + L1 * t + L2 * s + t1 + t4) / 2;
}
long long dmax(long long x, long long y) {
  if (deep[x] > deep[y])
    return x;
  else
    return y;
}
long long solve(long long a, long long b, long long c, long long d) {
  long long f1 = lca(a, b), f2 = lca(c, d);
  if (deep[f1] > deep[f2]) swap(f1, f2), swap(a, c), swap(b, d);
  if (lca(f1, f2) != f1) return -1;
  long long LA = Dist(a, b) * 2, LB = Dist(c, d) * 2;
  long long c1 = dmax(lca(a, c), lca(b, c));
  long long c2 = dmax(lca(a, d), lca(b, d));
  long long D = Dist(c1, c2);
  if (max(deep[c1], deep[c2]) < deep[f2]) return -1;
  long long t1 = Dist(a, c1), t2 = Dist(a, c2);
  long long t3 = Dist(c, c1), t4 = Dist(c, c2);
  if (t1 > t2)
    t1 = LA - t1;
  else
    t2 = LA - t2;
  if (t3 > t4)
    t3 = LB - t3;
  else
    t4 = LB - t4;
  long long ret = 0x7f7f7f7f7f7f;
  ret = min(ret, solve1(t1, LA, t3, LB));
  ret = min(ret, solve1(t2, LA, t4, LB));
  ret = min(ret, solve2(LA, LB, t1, t4, D));
  ret = min(ret, solve2(LA, LB, t2, t3, D));
  if (ret == 0x7f7f7f7f7f7f) return -1;
  return ret;
}
signed main() {
  long long x, y, a, b, c, d;
  scanf("%lld", &n);
  for (long long i = 1; i < n; i++) {
    scanf("%lld%lld", &x, &y);
    addedge(x, y);
    addedge(y, x);
  }
  basic_dfs(1, 0, 1);
  for (long long i = 1; i <= 20; i++) {
    for (long long j = 1; j <= n; j++) {
      fa[j][i] = fa[fa[j][i - 1]][i - 1];
    }
  }
  scanf("%lld", &m);
  for (long long i = 1; i <= m; i++) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    ans = solve(a, b, c, d);
    printf("%lld\n", ans);
  }
  return 0;
}