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 long long N = 200005;
long long n, m;
struct qq {
  long long x, y, last;
} e[N * 2];
long long num, last[N];
struct path {
  long long x, y, c;
  path() {}
  path(long long _x, long long _y, long long _c) {
    x = _x;
    y = _y;
    c = _c;
  }
};
void init(long long x, long long y) {
  num++;
  e[num].x = x;
  e[num].y = y;
  e[num].last = last[x];
  last[x] = num;
}
long long fa[N][21];
long long dep[N];
void dfs(long long x) {
  for (long long u = 1; u <= 20; u++) fa[x][u] = fa[fa[x][u - 1]][u - 1];
  for (long long u = last[x]; u != -1; u = e[u].last) {
    long long y = e[u].y;
    if (y == fa[x][0]) continue;
    fa[y][0] = x;
    dep[y] = dep[x] + 1;
    dfs(y);
  }
}
long long lca(long long x, long long y) {
  if (dep[y] > dep[x]) swap(x, y);
  for (long long u = 20; u >= 0; u--)
    if (dep[fa[x][u]] >= dep[y]) x = fa[x][u];
  if (x == y) return x;
  for (long long u = 20; u >= 0; u--)
    if (fa[x][u] != fa[y][u]) x = fa[x][u], y = fa[y][u];
  return fa[x][0];
}
long long s[5];
bool cmp(long long a, long long b) { return dep[a] < dep[b]; }
path mix(path x, path y) {
  if (x.c == 0 || y.c == 0) return path(0, 0, 0);
  s[1] = lca(x.x, y.x);
  s[2] = lca(x.x, y.y);
  s[3] = lca(x.y, y.x);
  s[4] = lca(x.y, y.y);
  sort(s + 1, s + 1 + 4, cmp);
  long long mx = max(dep[x.c], dep[y.c]), mn = min(dep[x.c], dep[y.c]);
  if (dep[s[1]] < mn || dep[s[3]] < mx) return path(0, 0, 0);
  return path(s[3], s[4], lca(s[3], s[4]));
}
long long dis(long long x, long long y) {
  long long z = lca(x, y);
  return dep[x] + dep[y] - 2 * dep[z];
}
long long mymin(long long x, long long y) {
  if (x == -1) return y;
  if (y == -1) return x;
  return x < y ? x : y;
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long tx, ty;
  long long d = exgcd(b % a, a, tx, ty);
  y = tx;
  x = ty - (b / a) * tx;
  return d;
}
long long same(long long t1, long long t2, long long f1, long long f2) {
  long long tx, ty;
  long long d = exgcd(f1, f2, tx, ty);
  long long t = ((t2 - t1) % f2 + f2) % f2;
  if (t % d != 0) return -1;
  tx = (tx * (t / d) % (f2 / d) + (f2 / d)) % (f2 / d);
  return tx * f1 + t1;
}
long long G(long long M, long long D, long long L, long long R) {
  long long t = L / D;
  if (t * D < L) t++;
  if (t * D <= R) return t;
  if (2 * D > M) return G(M, M - D, M - R, M - L);
  long long k = G(D, (-M % D + D) % D, L % D, R % D);
  L = L + M * k;
  R = R + M * k;
  t = L / D;
  if (t * D < L) t++;
  return t;
}
long long make(long long M, long long D, long long L, long long R) {
  long long tx, ty;
  long long g = exgcd(M, D, tx, ty);
  if ((L - 1) / g >= R / g) return -1;
  return G(M, D, L, R);
}
long long diff(long long t1, long long t2, long long f1, long long f2,
               long long d) {
  long long l = t2 - t1 - d, r = t2 - t1 + d;
  l = (l % f2 + f2) % f2;
  r = (r % f2 + f2) % f2;
  if (l % 2 != 0) return -1;
  if (l > r || l == 0) return t1 + r / 2;
  if (f2 == d * 2) return t1 + r / 2;
  long long p = make(f2, f1 % f2, l, r);
  if (p == -1) return p;
  return p * f1 + t1 + d - p * f1 % f2 / 2 + l / 2;
}
long long solve(path x, path y) {
  path z = mix(x, y);
  if (z.c == 0) return -1;
  long long d = dis(z.x, z.y), f1 = 2 * dis(x.x, x.y), f2 = 2 * dis(y.x, y.y);
  long long d1, d2;
  long long t1, t2, t3, t4;
  d1 = dis(x.x, z.x);
  d2 = dis(x.x, z.y);
  if (d1 < d2)
    t1 = d1, t2 = f1 - d2;
  else
    t1 = f1 - d1, t2 = d2;
  d1 = dis(y.x, z.x);
  d2 = dis(y.x, z.y);
  if (d1 < d2)
    t3 = d1, t4 = f2 - d2;
  else
    t3 = f2 - d1, t4 = d2;
  long long ans = -1;
  ans = mymin(ans, same(t1, t3, f1, f2));
  ans = mymin(ans, same(t2, t4, f1, f2));
  ans = mymin(ans, diff(t1, t4, f1, f2, d));
  ans = mymin(ans, diff(t2, t3, f1, f2, d));
  return ans;
}
int main() {
  num = 0;
  memset(last, -1, sizeof(last));
  scanf("%lld", &n);
  for (long long u = 1; u < n; u++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    init(x, y);
    init(y, x);
  }
  dep[1] = 1;
  dfs(1);
  scanf("%lld", &m);
  for (long long u = 1; u <= m; u++) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    printf("%lld\n", solve(path(a, b, lca(a, b)), path(c, d, lca(c, d))));
  }
  return 0;
}