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;
bool debug = 1;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
vector<int> mp[200025];
int p[200025][20], d[200025];
void dfs(int x, int pa) {
  d[x] = d[pa] + 1;
  p[x][0] = pa;
  for (int c : mp[x])
    if (c != pa) dfs(c, x);
}
void init() {
  for (int j = 1; (1 << j) <= n; j++)
    for (int i = 1; i <= n; i++) p[i][j] = p[p[i][j - 1]][j - 1];
}
int lca(int a, int b) {
  if (d[a] > d[b]) swap(a, b);
  int f = d[b] - d[a];
  for (int i = 0; (1 << i) <= f; i++)
    if ((1 << i) & f) b = p[b][i];
  if (a != b) {
    for (int i = 19; i >= 0; i--)
      if (p[a][i] != p[b][i]) {
        a = p[a][i];
        b = p[b][i];
      }
    a = p[a][0];
  }
  return a;
}
int dis(int x, int y) { return d[x] + d[y] - 2 * d[lca(x, y)]; }
int dper(int x, int y) {
  if (d[x] > d[y]) return x;
  return y;
}
long long gg(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
long long extend_gcd(long long a, long long b, long long &x, long long &y,
                     long long d) {
  if (b == 0) {
    x = d / a, y = 0;
    return a;
  } else {
    long long r = extend_gcd(b, a % b, y, x, d);
    y -= x * (a / b);
    return r;
  }
}
long long sameD(long long a, long long b, long long c, long long d) {
  long long g = gg(a, c);
  if ((b - d) % g != 0) return (1LL << 60);
  long long x, y;
  extend_gcd(a, -c, x, y, d - b);
  long long dx = c / g, dy = a / g;
  if (a * x + b > 0) {
    long long t = (a * x + b - 1) / (a * dx) + 1;
    x -= t * dx;
    y -= t * dy;
  }
  if (a * x + b < 0) {
    long long t = (-a * x - b - 1) / (a * dx) + 1;
    x += t * dx;
    y += t * dy;
  }
  return a * x + b;
}
long long gFun(long long M, long long D, long long L, long long R) {
  if (L == 0) return 0;
  if (!D) return 2147483647;
  if (2 * D > M) return gFun(M, M - D, M - R, M - L);
  if ((L - 1) / D < R / D) return (L + D - 1) / D;
  long long tmp = gFun(D, D - M % D, L % D, R % D);
  return tmp == 2147483647 ? 2147483647 : (tmp * M + L + D - 1) / D;
}
long long difD(long long t1, long long f1, long long t4, long long f2,
               long long d) {
  if ((d + t1 + t4) % 2 != 0) return (1LL << 60);
  long long l = t4 - t1 - d, r = t4 - t1 + d;
  l = (l % f2 + f2) % f2;
  r = (r % f2 + f2) % f2;
  long long tmp = 0;
  if (f2 != 2 * d && l <= r && l != 0) {
    if ((l - 1) / gg(f1, f2) >= r / gg(f1, f2))
      return (1LL << 60);
    else
      tmp = gFun(f2, f1 % f2, l, r);
  }
  long long q = (tmp * f1 + t1 + d - t4) / f2;
  return (d + tmp * f1 + q * f2 + t1 + t4) / 2;
}
void cal(int id) {
  int u, v, x, y;
  scanf("%d%d%d%d", &u, &v, &x, &y);
  int l1 = dper(lca(u, x), lca(u, y));
  int l2 = dper(lca(v, x), lca(v, y));
  int pa = dper(lca(u, v), lca(x, y));
  if (d[l1] < d[pa] && d[l2] < d[pa]) {
    puts("-1");
    return;
  }
  l1 = dper(l1, pa);
  l2 = dper(l2, pa);
  int t1 = dis(l1, u), t2 = dis(l2, u), t3 = dis(x, l1), t4 = dis(x, l2);
  int f1 = dis(u, v) * 2, f2 = dis(x, y) * 2;
  int d = dis(l1, l2);
  if (t1 > t2) {
    swap(t1, t2);
    swap(t3, t4);
  }
  t2 = f1 - t2;
  if (t3 > t4) {
    t3 = f2 - t3;
  } else
    t4 = f2 - t4;
  long long ans = (1LL << 60);
  ans = min(ans, sameD(f1, t1, f2, t3));
  ans = min(ans, sameD(f1, t2, f2, t4));
  ans = min(ans, difD(t1, f1, t4, f2, d));
  ans = min(ans, difD(t2, f1, t3, f2, d));
  if (ans == (1LL << 60)) ans = -1;
  printf("%lld\n", ans);
}
int main() {
  scanf("%d", &n);
  for (int a, b, i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    mp[a].push_back(b);
    mp[b].push_back(a);
  }
  dfs(1, 0);
  init();
  int t;
  scanf("%d", &t);
  for (int(i) = 1; (i) <= (int)(t); (i)++) cal(i);
  return 0;
}