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 MAXN = 200010;
using namespace std;
const long long INF = 100000000000000000ll;
int fa[MAXN][20], dep[MAXN];
vector<int> a[MAXN];
int n, q;
void dfs(int x, int f) {
  fa[x][0] = f;
  dep[x] = dep[f] + 1;
  for (int i = 0; i < a[x].size(); i++) {
    int u = a[x][i];
    if (u == f) continue;
    dfs(u, x);
  }
}
int lca(int u, int v) {
  if (dep[u] < dep[v]) swap(u, v);
  for (int i = 19; i >= 0; i--)
    if (dep[fa[u][i]] >= dep[v]) u = fa[u][i];
  if (u == v) return u;
  for (int i = 19; i >= 0; i--)
    if (fa[u][i] != fa[v][i]) {
      u = fa[u][i];
      v = fa[v][i];
    }
  return fa[u][0];
}
int lower(int x, int y) {
  if (dep[x] < dep[y]) return y;
  return x;
}
int dist(int x, int y) {
  int l = lca(x, y);
  return dep[x] + dep[y] - 2 * dep[l];
}
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long exgcd(long long x, long long y, long long g) {
  if (g == 0) return 0;
  long long t = exgcd(y % x, x, g % x);
  t = (g - t * y) / x;
  if (t < 0) {
    t += (-t) / y * y;
    t += y;
  }
  return t % y;
}
long long Samedir(long long t1, long long d1, long long t2, long long d2,
                  long long l) {
  long long g = (gcd(t1, t2)), m = d2 - d1;
  long long tt = t1;
  if (m < 0) m += t2;
  if (m % g) return INF;
  t1 /= g, m /= g, t2 /= g;
  return exgcd(t1, t2, m) * tt + d1;
}
long long G(long long x, long long y, long long l, long long r) {
  x %= y;
  if (x * 2 > y) return G(y - x, y, y - r, y - l);
  long long t = l / x, rest = y % x;
  long long a, b;
  if (l == t * x) return t;
  if ((t + 1ll) * x <= r) return t + 1ll;
  a = G(x - rest, x, l % x, r % x);
  a = (a * y - 1ll) / x + 1ll;
  b = a * x % y;
  a += (r - b) / x;
  return a;
}
long long D(long long x, long long y, long long l, long long r) {
  long long res = INF, g = gcd(x, y);
  if (l == 0) {
    res = y / g;
    l = 1;
  }
  if ((l - 1) / g >= r / g) return INF;
  return min(res, G(x, y, l, r));
}
long long Diffdir(long long t1, long long d1, long long t2, long long d2,
                  long long l) {
  long long bg = d2 - d1 - l, ed = d2 - d1 + l;
  long long p;
  if (bg < 0) bg += (-bg) / t2 * t2;
  if (ed < 0) ed += (-ed) / t2 * t2;
  bg = (bg + t2) % t2;
  ed = (ed + t2) % t2;
  if (ed % 2ll) return INF;
  if (t2 == l * 2) return d1 + ed / 2ll;
  if (bg > ed || bg == 0) return d1 + ed / 2ll;
  p = D(t1, t2, bg, ed);
  if (p == INF) return INF;
  return t1 * p + d1 + l - (p * t1 % t2 - bg) / 2ll;
}
long long Query(int u, int v, int x, int y) {
  int p1 = lca(u, v), p2 = lca(x, y);
  int p3 = lca(u, x), p4 = lca(v, x);
  int p5 = lca(u, y), p6 = lca(v, y);
  int p, a, b;
  p = lower(p1, p2);
  a = lower(p3, p5);
  b = lower(p4, p6);
  if (dep[a] < dep[p] && dep[b] < dep[p]) return -1;
  if (dep[a] < dep[p]) a = p;
  if (dep[b] < dep[p]) b = p;
  int d1 = dist(u, v) * 2, d4 = dist(x, y) * 2;
  int d2 = dist(u, a), d3 = dist(u, b);
  int d5 = dist(x, a), d6 = dist(x, b);
  int d = dist(a, b);
  if (d2 <= d3)
    d3 = d1 - d3;
  else
    d2 = d1 - d2;
  if (d5 <= d6)
    d6 = d4 - d6;
  else
    d5 = d4 - d5;
  return min(min(Samedir(d1, d2, d4, d5, d), Samedir(d1, d3, d4, d6, d)),
             min(Diffdir(d1, d2, d4, d6, d), Diffdir(d1, d3, d4, d5, d)));
}
int main() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    a[u].push_back(v);
    a[v].push_back(u);
  }
  dfs(1, 0);
  for (int j = 1; j < 20; j++)
    for (int i = 1; i <= n; i++) fa[i][j] = fa[fa[i][j - 1]][j - 1];
  scanf("%d", &q);
  int x, y;
  for (int i = 1, u, v; i <= q; i++) {
    scanf("%d%d%d%d", &u, &v, &x, &y);
    long long res = Query(u, v, x, y);
    if (res == INF)
      puts("-1");
    else
      printf("%lld\n", Query(u, v, x, y));
  }
  return 0;
}