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 gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
typedef struct G {
  long long a, b, g;
  G(long long a, long long b, long long g) : a(a), b(b), g(g) {}
} G;
G egcd(long long p, long long q) {
  if (q == 0) return G(1, 0, p);
  G cur = egcd(q, p % q);
  return G(cur.b, cur.a - cur.b * (p / q), cur.g);
}
long long first(long long p1, long long x1, long long p2, long long x2) {
  G cur = egcd(p1, p2);
  long long want = ((x2 - x1) % p2 + p2) % p2;
  if (want % cur.g != 0) return LLONG_MAX;
  want /= cur.g;
  p1 /= cur.g;
  p2 /= cur.g;
  long long a = (cur.a % p2 + p2) % p2;
  a = a * want % p2;
  return a * p1 * cur.g + x1;
}
long long go2(long long MOD, long long a, long long l, long long r) {
  a %= MOD;
  if (2 * a > MOD) return go2(MOD, MOD - a, MOD - r, MOD - l);
  long long m = l / a;
  if (l == m * a) return m;
  if ((m + 1) * a <= r) return m + 1;
  long long k = go2(a, a - MOD % a, l % a, r % a);
  m = (k * MOD + l + a - 1) / a;
  return m;
}
long long go(long long MOD, long long a, long long l, long long r) {
  long long g = gcd(MOD, a);
  if ((l + g - 1) / g > r / g) return LLONG_MAX;
  return go2(MOD, a, l, r);
}
long long first(long long p1, long long x1, long long p2, long long x2,
                long long lim) {
  long long l = ((x2 - x1 - lim) % p2 + p2) % p2,
            h = ((x2 - x1 + lim) % p2 + p2) % p2;
  if (l % 2 != 0 || h % 2 != 0) return LLONG_MAX;
  if (l == 0 || l > h || 2 * lim == p2) {
    return x1 + h / 2;
  }
  long long a = go(p2, p1, l, h);
  if (a == LLONG_MAX) return LLONG_MAX;
  long long ret = a * p1 + x1 + lim - (a * p1 % p2 - l) / 2;
  return ret;
}
const int MAXN = 200000;
const int MAXE = MAXN - 1;
int n, nq;
int fst[MAXN];
int nxt[2 * MAXE];
int to[2 * MAXE];
int h[MAXN];
int par[MAXN][20];
int q[MAXN], qhead, qtail;
void init() {
  for (int i = (0); i < (n); ++i) h[i] = par[i][0] = -1;
  qhead = qtail = 0;
  q[qhead++] = 0;
  h[0] = 0;
  par[0][0] = 0;
  while (qtail < qhead) {
    int at = q[qtail++];
    for (int x = fst[at]; x != -1; x = nxt[x])
      if (h[to[x]] == -1) {
        h[to[x]] = h[at] + 1;
        par[to[x]][0] = at;
        q[qhead++] = to[x];
      }
  }
  for (int k = (0); k < (19); ++k)
    for (int j = (0); j < (n); ++j) par[j][k + 1] = par[par[j][k]][k];
}
int lca(int u, int v) {
  if (h[u] < h[v]) swap(u, v);
  for (int k = 19; k >= 0; --k)
    if (h[par[u][k]] >= h[v]) {
      u = par[u][k];
    }
  if (u == v) return u;
  for (int k = 19; k >= 0; --k)
    if (par[u][k] != par[v][k]) {
      u = par[u][k], v = par[v][k];
    }
  return par[u][0];
}
long long calc(int u, int v, int x, int y) {
  int uv = lca(u, v), xy = lca(x, y), ux = lca(u, x), uy = lca(u, y),
      vx = lca(v, x), vy = lca(v, y);
  int du = 0, dv = 0, dx = 0, dy = 0;
  if (min(min(h[ux], h[uy]), min(h[vx], h[vy])) >= max(h[uv], h[xy])) {
    if (h[ux] >= h[uy]) {
      du = h[u] - h[ux];
      dx = h[x] - h[ux];
    } else {
      du = h[u] - h[uy];
      dx = h[x] + h[uy] - 2 * h[ux];
    }
    if (h[vx] >= h[vy]) {
      dv = h[v] - h[vx];
      dy = h[y] + h[vx] - 2 * h[vy];
    } else {
      dv = h[v] - h[vy];
      dy = h[y] - h[vy];
    }
  } else if (min(h[ux], h[uy]) >= max(h[uv], h[xy])) {
    dv = h[v] + h[xy] - 2 * h[uv];
    dy = h[y] - h[xy];
    if (h[ux] >= h[uy]) {
      du = h[u] - h[ux];
      dx = h[x] - h[ux];
    } else {
      du = h[u] - h[uy];
      dx = h[x] + h[uy] - 2 * h[xy];
    }
  } else if (min(h[vx], h[vy]) >= max(h[uv], h[xy])) {
    du = h[u] + h[xy] - 2 * h[uv];
    dx = h[x] - h[xy];
    if (h[vx] >= h[vy]) {
      dv = h[v] - h[vx];
      dy = h[y] + h[vx] - 2 * h[xy];
    } else {
      dv = h[v] - h[vy];
      dy = h[y] - h[vy];
    }
  } else {
    swap(u, x);
    swap(v, y);
    swap(uv, xy);
    swap(uy, vx);
    if (min(h[ux], h[uy]) >= max(h[uv], h[xy])) {
      dv = h[v] + h[xy] - 2 * h[uv];
      dy = h[y] - h[xy];
      if (h[ux] >= h[uy]) {
        du = h[u] - h[ux];
        dx = h[x] - h[ux];
      } else {
        du = h[u] - h[uy];
        dx = h[x] + h[uy] - 2 * h[xy];
      }
    } else if (min(h[vx], h[vy]) >= max(h[uv], h[xy])) {
      du = h[u] + h[xy] - 2 * h[uv];
      dx = h[x] - h[xy];
      if (h[vx] >= h[vy]) {
        dv = h[v] - h[vx];
        dy = h[y] + h[vx] - 2 * h[xy];
      } else {
        dv = h[v] - h[vy];
        dy = h[y] - h[vy];
      }
    } else {
      return -1;
    }
  }
  int duv = h[u] + h[v] - 2 * h[uv], dxy = h[x] + h[y] - 2 * h[xy],
      d = duv - du - dv;
  dv += duv;
  if (dx + dy <= dxy) {
    dy += dxy;
  } else {
    dx = 2 * dxy - dx;
    dy = dxy - dy;
  }
  long long cur1 = first(2 * duv, du, 2 * dxy, dx);
  long long cur2 = first(2 * duv, dv, 2 * dxy, dy);
  long long cur3 = first(2 * duv, du, 2 * dxy, dy, d);
  long long cur4 = first(2 * duv, dv, 2 * dxy, dx, d);
  long long ret = min(min(cur1, cur2), min(cur3, cur4));
  return ret == LLONG_MAX ? -1 : ret;
}
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) fst[i] = -1;
  for (int i = (0); i < (n - 1); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    nxt[2 * i + 0] = fst[a];
    fst[a] = 2 * i + 0;
    to[2 * i + 0] = b;
    nxt[2 * i + 1] = fst[b];
    fst[b] = 2 * i + 1;
    to[2 * i + 1] = a;
  }
  init();
  scanf("%d", &nq);
  for (int qi = (0); qi < (nq); ++qi) {
    int u, v, x, y;
    scanf("%d%d%d%d", &u, &v, &x, &y);
    --u, --v, --x, --y;
    long long ret = calc(u, v, x, y);
    cout << ret << endl;
  }
}
int main() {
  run();
  return 0;
}