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>
const int mxn = 2e5 + 5;
const int mxlg = 18;
int n;
std::vector<int> adj[mxn];
namespace Tree {
int fa[mxn], dep[mxn], jmp[mxn][mxlg];
int dfn[mxn], ed[mxn], on[mxn], tim;
void dfs0(int u, int p) {
  on[tim] = u;
  dfn[u] = tim++;
  jmp[u][0] = fa[u];
  for (int i = 0; i < (int)(mxlg - 1); ++i) jmp[u][i + 1] = jmp[jmp[u][i]][i];
  for (int v : adj[u]) {
    if (v == p) continue;
    fa[v] = u;
    dep[v] = dep[u] + 1;
    dfs0(v, u);
  }
  ed[u] = tim;
}
int lca(int u, int v) {
  if (dep[u] > dep[v]) std::swap(u, v);
  for (int i = 0; i < (int)(mxlg); ++i)
    if ((dep[v] - dep[u]) >> i & 1) v = jmp[v][i];
  if (u == v) return u;
  for (int i = mxlg - 1; ~i; --i)
    if (jmp[u][i] != jmp[v][i]) u = jmp[u][i], v = jmp[v][i];
  return jmp[u][0];
}
int dist(int u, int v) {
  int l = lca(u, v);
  return dep[u] + dep[v] - 2 * dep[l];
}
void init() {
  tim = 0;
  dfs0(0, -1);
}
bool comp_dfn(int a, int b) { return dfn[a] < dfn[b]; }
void intersect(int a1, int b1, int a2, int b2, int &c1, int &c2) {
  static int vec[15];
  int vsz = 0;
  vec[vsz++] = a1;
  vec[vsz++] = b1;
  vec[vsz++] = a2;
  vec[vsz++] = b2;
  std::sort(vec, vec + vsz, comp_dfn);
  int osz = vsz;
  for (int i = 0; i < (int)(osz - 1); ++i) vec[vsz++] = lca(vec[i], vec[i + 1]);
  std::sort(vec, vec + vsz, comp_dfn);
  vsz = std::unique(vec, vec + vsz) - vec;
  static int cnt[mxn], nfa[mxn], ndep[mxn];
  static std::vector<int> nadj[mxn];
  for (int i = 0; i < (int)(vsz); ++i) {
    int u = vec[i];
    cnt[u] = 0;
    ndep[u] = 0;
    nadj[u].clear();
  }
  static int stk[15];
  int top = 0;
  for (int i = 0; i < (int)(vsz); ++i) {
    while (top && !(dfn[stk[top - 1]] <= dfn[vec[i]] &&
                    ed[vec[i]] <= ed[stk[top - 1]]))
      --top;
    if (top)
      nadj[stk[top - 1]].push_back(vec[i]),
          nfa[vec[i]] = stk[top - 1], ndep[vec[i]] = ndep[stk[top - 1]] + 1;
    stk[top++] = vec[i];
  }
  auto paint = [&](int u, int v) {
    if (ndep[u] > ndep[v]) std::swap(u, v);
    while (ndep[v] > ndep[u]) {
      ++cnt[v];
      v = nfa[v];
    }
    while (u != v) {
      ++cnt[u];
      ++cnt[v];
      u = nfa[u];
      v = nfa[v];
    }
    ++cnt[u];
  };
  paint(a1, b1);
  paint(a2, b2);
  std::function<void(int)> dfs;
  std::function<void(int, int &)> fnd;
  c1 = c2 = -1;
  fnd = [&](int u, int &ans) {
    if (cnt[u] == 2)
      ans = u;
    else
      return;
    for (int v : nadj[u]) {
      fnd(v, ans);
    }
  };
  dfs = [&](int u) {
    if (cnt[u] == 2) {
      for (int v : nadj[u]) {
        if (c1 == -1)
          fnd(v, c1);
        else
          fnd(v, c2);
      }
      if (c1 == -1) c1 = u;
      if (c2 == -1) c2 = u;
      return;
    }
    for (int v : nadj[u]) {
      dfs(v);
    }
  };
  dfs(vec[0]);
}
}  // namespace Tree
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int exgcd(int a, int b, int &x, int &y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  } else {
    int d = exgcd(b, a % b, y, x);
    y -= (a / b) * x;
    return d;
  }
}
int inv(int x, int n) {
  int a, b;
  int d = exgcd(x, n, a, b);
  assert(d == 1);
  return (a % n + n) % n;
}
long long clash(int A, int dA, int B, int dB) {
  if (dA == dB) {
    if (A != B) return 1LL << 60;
    return A;
  }
  if (dA > dB) {
    std::swap(A, B);
    std::swap(dA, dB);
  }
  int tar = (B + dB - A) % dB;
  int g = gcd(dA, dB);
  if (tar % g != 0) return 1LL << 60;
  int x = inv(dA / g, dB / g);
  int tms = 1LL * (tar / g) * x % (dB / g);
  long long ans = A + 1LL * tms * dA;
  return ans;
}
long long bang(int A, int dA, int x, int delta, int len, int n) {
  if (x <= len) return A;
  if (delta == 0) return 1LL << 60;
  if (delta > n - delta) {
    int ndelta = n - delta;
    int nx = (n - x + n - (n - len)) % n;
    return bang(A, dA, nx, ndelta, len, n);
  }
  int base = (n - x + delta - 1) / delta;
  int nx = (x + 1LL * base * delta) % n;
  if (nx <= len) return A + 1LL * base * dA;
  int tms = (n + delta - 1) / delta;
  int stp = tms * delta - n;
  long long temp = bang(0, 1, nx, stp, len, delta);
  if (temp >= 1LL << 60) return 1LL << 60;
  long long real = temp * tms - (nx + temp * stp) / delta;
  long long ans = A + 1LL * dA * (base + real);
  return ans;
}
long long boom(int A, int dA, int Bl, int Br, int dB) {
  int x = (A - Bl + dB) % dB;
  int delta = dA % dB;
  int len = Br - Bl;
  int n = dB;
  long long real = bang(A, dA, x, delta, len, n);
  return real;
}
long long drill(int A, int dA, int Bl, int Br, int dB) {
  long long ovo = boom(A, dA, Bl, Br, dB);
  if (ovo >= 1LL << 60) return 1LL << 60;
  return ovo + (Br - ovo % dB) / 2;
}
long long Query(int a1, int b1, int a2, int b2) {
  int c1, c2;
  Tree::intersect(a1, b1, a2, b2, c1, c2);
  if (c1 == -1) return -1;
  int a = std::min(Tree::dist(a1, c1), Tree::dist(a1, c2));
  int b = std::min(Tree::dist(a2, c1), Tree::dist(a2, c2));
  int c = Tree::dist(c1, c2);
  int d = std::min(Tree::dist(b1, c1), Tree::dist(b1, c2));
  int e = std::min(Tree::dist(b2, c1), Tree::dist(b2, c2));
  int A = a + c + d, B = b + c + e;
  assert(A == Tree::dist(a1, b1));
  assert(B == Tree::dist(a2, b2));
  long long ans = 1LL << 60;
  int aR = Tree::dist(a1, c1) <= Tree::dist(a1, c2) ? a : a + c + 2 * d;
  int aL = Tree::dist(a1, c1) <= Tree::dist(a1, c2) ? a + c + 2 * d : a;
  int bR = Tree::dist(a2, c1) <= Tree::dist(a2, c2) ? b : b + c + 2 * e;
  int bL = Tree::dist(a2, c1) <= Tree::dist(a2, c2) ? b + c + 2 * e : b;
  ans = std::min(ans, clash(aR, 2 * A, bR, 2 * B));
  ans = std::min(ans, clash(aL, 2 * A, bL, 2 * B));
  if ((aL + bR + c) % 2 == 0) {
    ans = std::min(ans, drill(aL, 2 * A, bR, bR + c, 2 * B));
    ans = std::min(ans, drill(bR, 2 * B, aL, aL + c, 2 * A));
  }
  if ((aR + bL + c) % 2 == 0) {
    ans = std::min(ans, drill(aR, 2 * A, bL, bL + c, 2 * B));
    ans = std::min(ans, drill(bL, 2 * B, aR, aR + c, 2 * A));
  }
  return ans >= 1LL << 60 ? -1 : ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n - 1); ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    --u, --v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  Tree::init();
  int q;
  scanf("%d", &q);
  while (q--) {
    int a1, b1, a2, b2;
    scanf("%d %d %d %d", &a1, &b1, &a2, &b2);
    --a1, --b1, --a2, --b2;
    printf("%lld\n", Query(a1, b1, a2, b2));
  }
  return 0;
}