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;
template <class T>
bool setmax(T &_a, T _b) {
  if (_b > _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
bool setmin(T &_a, T _b) {
  if (_b < _a) {
    _a = _b;
    return true;
  }
  return false;
}
template <class T>
T gcd(T _a, T _b) {
  return _b == 0 ? _a : gcd(_b, _a % _b);
}
template <class T>
T ext_gcd(T a, T b, T &x, T &y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  long long nx, ny, d;
  d = ext_gcd(b, a % b, nx, ny);
  x = ny, y = nx - (a / b) * ny;
  return d;
}
const int MAXN = 200010;
const int MAXLog = 20;
const long long NO = 1LL << 55;
int up[MAXN][MAXLog], dep[MAXN];
vector<int> es[MAXN];
int n;
int lst[MAXN * 2], ind[MAXN], cnt;
pair<int, int> lca_rmq[MAXN * 2][MAXLog];
int lca_log[MAXN * 2];
void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  up[x][0] = fa;
  lst[++cnt] = x, ind[x] = cnt;
  for (int i = 0; up[x][i] > 0; ++i) up[x][i + 1] = up[up[x][i]][i];
  for (int y : es[x])
    if (y != fa) {
      dfs(y, x);
      lst[++cnt] = x;
    }
}
void pre() {
  memset(up, 0, sizeof(up));
  memset(dep, 0, sizeof(dep));
  cnt = 0;
  dfs(1, 0);
  for (int i = int(1); i <= int(cnt); ++i)
    lca_rmq[i][0] = make_pair(dep[lst[i]], lst[i]);
  for (int j = int(0); j <= int((MAXLog - 1) - 1); ++j)
    for (int i = int(1); i <= int(cnt - (1 << j)); ++i)
      lca_rmq[i][j + 1] = min(lca_rmq[i][j], lca_rmq[i + (1 << j)][j]);
  memset(lca_log, 0xff, sizeof(lca_log));
  for (int j = int(0); j <= int((MAXLog)-1); ++j)
    if ((1 << j) <= cnt) lca_log[1 << j] = j;
  for (int i = int(1); i <= int(cnt); ++i)
    if (lca_log[i] < 0) lca_log[i] = lca_log[i - 1];
}
int lca(int x, int y) {
  int i = ind[x], j = ind[y];
  if (i > j) swap(i, j);
  int k = lca_log[j - i + 1];
  pair<int, int> r = min(lca_rmq[i][k], lca_rmq[j - (1 << k) + 1][k]);
  return r.second;
}
int go_up(int x, int d) {
  for (int i = int((MAXLog)-1); i >= int(0); --i)
    if (d & (1 << i)) x = up[x][i];
  return x;
}
int dis(int x, int y) {
  int z = lca(x, y);
  return dep[x] + dep[y] - 2 * dep[z];
}
int go(int x, int y, int d) {
  int z = lca(x, y);
  int dx = dep[x] - dep[z];
  int dy = dep[y] - dep[z];
  {};
  if (d <= dx)
    return go_up(x, d);
  else
    return go_up(y, dx + dy - d);
}
int proj(int p, int x, int y) {
  int d = dis(p, x) + dis(p, y) - dis(x, y);
  {};
  d /= 2;
  return go(p, x, d);
}
long long solve_a(long long, long long, long long, long long);
long long solve_b(long long, long long, long long, long long, long long,
                  long long);
long long solve_c(long long, long long, long long, long long, long long);
long long solve_d(long long, long long, long long, long long);
long long solve_a(long long t1, long long p1, long long t2, long long p2) {
  if (p1 > p2) swap(t1, t2), swap(p1, p2);
  if (p1 == p2) return p1;
  long long x, y, g = ext_gcd(t1, t2, x, y);
  y = -y;
  if ((p2 - p1) % g != 0) return NO;
  long long times = (p2 - p1) / g;
  x *= times, y *= times;
  long long z1 = t2 / g, z2 = t1 / g;
  long long ux = 0;
  if (x < 0) ux = (-x - 1) / z1 + 1;
  long long uy = 0;
  if (y < 0) uy = (-y - 1) / z2 + 1;
  long long u = max(ux, uy);
  x += z1 * u, y += z2 * u;
  long long vx = x / z1, vy = y / z2, v = min(vx, vy);
  x -= z1 * v, y -= z2 * v;
  {};
  {};
  return p1 + x * t1;
}
long long solve_b(long long t1, long long l1, long long r1, long long t2,
                  long long l2, long long r2) {
  {};
  auto cal = [](long long t1, long long p1, long long t2, long long p2,
                long long d) -> long long {
    if ((p2 - p1) % 2 == 0) {
      if (t1 % 2 == 0 && t2 % 2 == 0) return solve_c(t1, p1, t2, p2, d);
      if (t1 % 2 == 1 && t2 % 2 == 0) return solve_c(t1 * 2, p1, t2, p2, d);
      if (t1 % 2 == 0 && t2 % 2 == 1) return solve_c(t1, p1, t2 * 2, p2, d);
      long long ans = NO;
      setmin(ans, solve_c(t1 * 2, p1, t2 * 2, p2, d));
      setmin(ans, solve_c(t1 * 2, p1 + t1, t2 * 2, p2 + t2, d));
      return ans;
    } else {
      if (t1 % 2 == 0 && t2 % 2 == 0) return NO;
      if (t1 % 2 == 1 && t2 % 2 == 0)
        return solve_c(t1 * 2, p1 + t1, t2, p2, d);
      if (t1 % 2 == 0 && t2 % 2 == 1)
        return solve_c(t1, p1, t2 * 2, p2 + t2, d);
      long long ans = NO;
      setmin(ans, solve_c(t1 * 2, p1 + t1, t2 * 2, p2, d));
      setmin(ans, solve_c(t1 * 2, p1, t2 * 2, p2 + t2, d));
      return ans;
    }
  };
  {};
  long long ans = NO, d = r1 - l1;
  setmin(ans, cal(t1, l1, t2, r2, d));
  setmin(ans, cal(t2, l2, t1, r1, d));
  {};
  return ans;
}
long long solve_c(long long t1, long long p1, long long t2, long long p2,
                  long long d) {
  {};
  long long p = p2 - p1, t = t2;
  if (p < 0) p += t2;
  long long M = t1, m = t % M, l = (-p % M + M) % M, r = ((d - p) % M + M) % M;
  long long z;
  if (l <= r)
    z = solve_d(M, m, l, r);
  else {
    z = NO;
    setmin(z, solve_d(M, m, l, M - 1));
    setmin(z, solve_d(M, m, 0, r));
  }
  {};
  if (z == NO) return NO;
  long long q2 = z * t + p + p1;
  long long q1 = (q2 - p1) / t1 * t1 + p1;
  {};
  return (q1 + q2) / 2;
}
long long solve_d(long long M, long long m, long long l, long long r) {
  {};
  {};
  if (m == 0) return l == 0 ? 0 : NO;
  if (l == 0) return 0;
  if (m * 2 > M) return solve_d(M, M - m, M - r, M - l);
  long long k = (l + m - 1) / m;
  if (k * m <= r) return k;
  {};
  long long l0 = l % m, r0 = r % m, m0 = (-M % m + m) % m;
  long long t = solve_d(m, m0, l0, r0);
  if (t == NO) return NO;
  return (l + M * t + m - 1) / m;
}
long long solve(int a, int b, int x, int y) {
  {};
  int pa = proj(a, x, y);
  int push_back = proj(b, x, y);
  if (pa == push_back && proj(pa, a, b) != pa) return NO;
  int nc = dis(pa, push_back);
  int na = dis(a, pa), nb = dis(b, push_back), nx, ny;
  bool rev = false;
  if (dis(x, pa) <= dis(x, push_back)) {
    nx = dis(x, pa), ny = dis(y, push_back);
  } else {
    rev = true;
    nx = dis(x, push_back), ny = dis(y, pa);
  }
  int t1 = (na + nb + nc) * 2, t2 = (nx + ny + nc) * 2;
  long long ans = NO;
  {};
  {
    int u1 = na, v1 = na + nc + 2 * nb;
    int u2 = nx, v2 = nx + nc + 2 * ny;
    if (rev) swap(u2, v2);
    setmin(ans, solve_a(t1, u1, t2, u2));
    setmin(ans, solve_a(t1, v1, t2, v2));
  }
  if (!rev) {
    setmin(ans, solve_b(t1, na, na + nc, t2, nx + nc + 2 * ny,
                        nx + 2 * nc + 2 * ny));
    setmin(ans, solve_b(t1, na + nc + 2 * nb, na + 2 * nc + 2 * nb, t2, nx,
                        nx + nc));
  } else {
    setmin(ans, solve_b(t1, na, na + nc, t2, nx, nx + nc));
    setmin(ans, solve_b(t1, na + nc + 2 * nb, na + 2 * nc + 2 * nb, t2,
                        nx + nc + 2 * ny, nx + 2 * nc + 2 * ny));
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = int(1); i <= int(n); ++i) es[i].clear();
  for (int i = int(1); i <= int(n - 1); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    es[a].push_back(b), es[b].push_back(a);
  }
  pre();
  int cs;
  scanf("%d", &cs);
  for (int k = int(0); k <= int((cs)-1); ++k) {
    int a, b, x, y;
    scanf("%d%d%d%d", &a, &b, &x, &y);
    long long ans = solve(a, b, x, y);
    if (ans == NO) ans = -1;
    printf("%lld\n", ans);
  }
  return 0;
}