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;
int n, q, a, b, v[4], head[200500], cnt, dep[200500], f[200500][18];
struct edge {
  int t, next;
} ed[200500 * 2];
void adde(int f, int t) {
  ed[++cnt] = (edge){t, head[f]};
  head[f] = cnt;
  ed[++cnt] = (edge){f, head[t]};
  head[t] = cnt;
}
void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  f[u][0] = fa;
  for (int i = 1; i <= 17; i++) f[u][i] = f[f[u][i - 1]][i - 1];
  for (int i = head[u]; i; i = ed[i].next)
    if (ed[i].t != fa) dfs(ed[i].t, u);
}
int LCA(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  for (int i = 17; i >= 0; i--)
    if (dep[x] - dep[y] >= (1 << i)) x = f[x][i];
  if (x == y) return x;
  for (int i = 17; i >= 0; i--)
    if (f[x][i] != f[y][i]) x = f[x][i], y = f[y][i];
  return f[x][0];
}
int doit(int x, int y) { return dep[x] > dep[y] ? x : y; }
int getdis(int x, int y) { return dep[x] + dep[y] - 2 * dep[LCA(x, y)]; }
bool chk(int x, int y, int a) {
  return getdis(x, a) + getdis(y, a) == getdis(x, y);
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    x = 1, y = 0;
    return a;
  }
  long long g = exgcd(b, a % b, y, x);
  y -= a / b * x;
  return g;
}
long long excrt(long long b, long long a, long long d, long long c) {
  long long x, y;
  long long g = exgcd(b, d, x, y), l = b / g * d;
  if ((a - c) % g) return 1e18;
  long long as = a, tp = (c - a % d + d) % d / g;
  as = (as + tp * b % l * x) % l;
  as = (as + l) % l;
  return as;
}
long long doit(long long x, long long y, long long a, long long b) {
  x %= y;
  if (a < 0) {
    long long tp = (-a) / y;
    tp = (tp + 1) * y;
    a += tp;
    b += tp;
  }
  long long tp = a / y * y;
  a -= tp;
  b -= tp;
  if (b >= y) return 0;
  if (!x) return -1;
  if (b / x > (a - 1) / x) return (a - 1) / x + 1;
  long long ry = doit(y, x, -b, -a);
  if (ry == -1) return -1;
  return (b + ry * y) / x;
}
long long solve(int l1, int r1, int l2, int r2, int sl, int ty) {
  long long as = 1e18, s1 = l1 + r1 + sl, s2 = l2 + r2 + sl;
  for (int f = 0; f < 2; f++) {
    int lb, rb;
    if (!f)
      lb = l1, rb = ty ? r2 + sl - 1 : l2;
    else
      lb = sl + l1 - 1, rb = ty ? r2 : l2 + sl - 1;
    for (int p = -1; p < 2; p += 2)
      for (int q = -1; q < 2; q += 2)
        as = min(as, excrt(s1 * 2 - 2, s1 * 2 - 2 + p * lb, s2 * 2 - 2,
                           s2 * 2 - 2 + q * rb));
  }
  long long cr1 = s1 * 2 - 2, cr2 = s2 * 2 - 2;
  long long lb = l1, rb = l1 + sl - 1, vl = s2 * 2 + l1 - l2 - 2, as1;
  if (ty) vl = sl + l1 + r2 - 1;
  as1 = doit(cr1, cr2, vl - 2 * rb, vl - 2 * lb);
  if (vl & 1) as1 = -1;
  if (as1 != -1) {
    long long k1 = as1, k2 = (k1 * cr1 - (vl - 2 * rb)) / cr2;
    long long r1 = (cr2 * k2 - cr1 * k1 + vl) / 2;
    as = min(as, k1 * cr1 + r1);
  }
  lb = s1 * 2 - l1 - sl - 1, rb = s1 * 2 - l1 - 2, vl = s1 * 2 + l2 - l1 - 2;
  if (ty) vl = s1 + s2 + sl + l2 + r1 - 3;
  as1 = doit(cr1, cr2, vl - 2 * rb, vl - 2 * lb);
  if (vl & 1) as1 = -1;
  if (as1 != -1) {
    long long k1 = as1, k2 = (k1 * cr1 - (vl - 2 * rb)) / cr2;
    long long r1 = (cr2 * k2 - cr1 * k1 + vl) / 2;
    as = min(as, k1 * cr1 + r1);
  }
  if (as > 1e16) as = -1;
  return as;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d%d", &a, &b), adde(a, b);
  dfs(1, 0);
  scanf("%d", &q);
  while (q--) {
    for (int i = 0; i < 4; i++) scanf("%d", &v[i]);
    int as = 0;
    for (int i = 0; i < 4; i++)
      for (int j = i + 1; j < 4; j++) as = doit(as, LCA(v[i], v[j]));
    if (!chk(v[0], v[1], as) || !chk(v[2], v[3], as)) {
      printf("-1\n");
      continue;
    }
    int s1 = as, s2 = as, ds = 0;
    for (int i = 0; i < 4; i++)
      for (int j = i + 1; j < 4; j++) {
        int l = LCA(v[i], v[j]);
        if (!chk(v[0], v[1], l) || !chk(v[2], v[3], l)) continue;
        int d1 = getdis(l, s1);
        if (d1 > ds) ds = d1, s2 = l;
      }
    if (getdis(v[0], s1) > getdis(v[0], s2)) swap(s1, s2);
    int l1 = getdis(v[0], s1), r1 = getdis(v[1], s2), l2 = getdis(v[2], s1),
        r2 = getdis(v[3], s2), sl = getdis(s1, s2), fg = 0;
    if (l2 + r2 > getdis(v[2], v[3])) l2 -= sl, r2 -= sl, fg = 1, swap(l2, r2);
    printf("%lld\n", solve(l1, r1, l2, r2, sl + 1, fg));
  }
}