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;
long long x, y, Lx, Ly;
int lb, lc, X, z, n, m, tt, i, b1, b2, c1, c2, j, Mt, tl, ct;
int que[200011], fa[200011][19];
int g[200011], nxt[400011], Y[400011], dep[200011];
bool pc, pz;
void star(int i, int j) {
  tt++;
  nxt[tt] = g[i];
  g[i] = tt;
  Y[tt] = j;
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) return x = 1, y = 0, a;
  long long g = exgcd(b, a % b, y, x);
  ;
  return y -= a / b * x, g;
}
long long Same(long long A, long long B, long long u, long long v) {
  long long x, y, z(v - u), g, ti;
  g = exgcd(A, B, x, y);
  if (z % g) return 1e18;
  x *= z / g, y *= -z / g, A /= g, B /= g;
  if (x < 0)
    ti = max((-x - 1) / B + 1, (-y - 1) / A + 1), x += ti * B, y += ti * A;
  ti = min(x / B, y / A), x -= ti * B, y += ti * A;
  return A * g * x + u;
}
void bfs(int st) {
  int l, r, x, j, k;
  l = r = 1;
  que[l] = st;
  while (l <= r) {
    x = que[l];
    j = g[x];
    while (j != 0) {
      k = Y[j];
      if (k != fa[x][0]) {
        r++;
        que[r] = k;
        fa[k][0] = x;
        dep[k] = dep[x] + 1;
      }
      j = nxt[j];
    }
    l++;
  }
}
int getlca(int x, int z) {
  int i, l, e;
  if (dep[x] < dep[z]) swap(x, z);
  l = dep[x] - dep[z];
  e = 0;
  while (l) {
    if (l % 2 == 1) x = fa[x][e];
    l /= 2;
    e++;
  }
  if (x == z) return x;
  for (i = 18; i >= 0; i--)
    if (fa[x][i] != fa[z][i]) {
      x = fa[x][i];
      z = fa[z][i];
    }
  return fa[x][0];
}
int dmax(int a, int b) {
  if (dep[a] > dep[b])
    return a;
  else
    return b;
}
int dis(int x, int z) { return dep[x] + dep[z] - 2 * dep[getlca(x, z)]; }
long long G(long long M, long long D, long long L, long long R) {
  long long t;
  if ((L - 1) / D < R / D) return (L - 1 + D) / D;
  if (D + D > M) return G(M, M - D, M - R, M - L);
  t = G(D, D - M % D, L % D, R % D);
  return (M * t + L - 1 + D) / D;
}
long long diff(long long A, long long B, long long u, long long v,
               long long L) {
  long long l, r, t, s;
  t = 0;
  l = ((v - u - L) % B + B) % B;
  r = ((v - u + L) % B + B) % B;
  if (l & 1) return 1e18;
  if (B != L + L && l <= r && l) {
    if ((l - 1) / gcd(A, B) >= r / gcd(A, B)) return 1e18;
    t = G(B, A % B, l, r);
  }
  s = (t * A + u + L - v) / B;
  return (L + A * t + B * s + u + v) / 2;
}
long long Work(int a, int b, int c, int d) {
  int u, v, t1, t2, t3, t4, c1, c2, La, Lb, D;
  long long ans;
  u = getlca(a, b);
  v = getlca(c, d);
  if (dep[u] > dep[v]) swap(u, v), swap(a, c), swap(b, d);
  if (getlca(u, v) != u) return -1;
  c1 = dmax(getlca(a, c), getlca(a, d));
  c2 = dmax(getlca(b, c), getlca(b, d));
  if (max(dep[c1], dep[c2]) < dep[v]) return -1;
  c1 = dmax(c1, v);
  c2 = dmax(c2, v);
  La = 2 * dis(a, b);
  Lb = 2 * dis(c, d);
  t1 = dis(a, c1);
  t2 = dis(a, c2);
  t3 = dis(c, c1);
  t4 = dis(c, c2);
  D = dis(c1, c2);
  if (t1 > t2)
    t1 = La - t1;
  else
    t2 = La - t2;
  if (t3 > t4)
    t3 = Lb - t3;
  else
    t4 = Lb - t4;
  ans = 1e18;
  ans = min(Same(La, Lb, t1, t3), Same(La, Lb, t2, t4));
  ans = min(ans, min(diff(La, Lb, t1, t4, D), diff(La, Lb, t2, t3, D)));
  if (ans == 1e18) ans = -1;
  return ans;
}
int main() {
  pc = true;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &X, &z);
    star(X, z);
    star(z, X);
  }
  bfs(1);
  for (i = 1; i <= 18; i++)
    for (j = 1; j <= n; j++) fa[j][i] = fa[fa[j][i - 1]][i - 1];
  scanf("%d", &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d%d%d", &b1, &b2, &c1, &c2);
    printf("%lld\n", Work(b1, b2, c1, c2));
  }
}