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;
const int N = 200005;
struct edge {
  int to, next;
} e[N * 2];
int head[N], tot;
void add(int x, int y) {
  e[++tot] = (edge){y, head[x]};
  head[x] = tot;
}
int fa[N][20], dep[N];
void dfs(int x) {
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa[x][0]) {
      fa[e[i].to][0] = x;
      dep[e[i].to] = dep[x] + 1;
      dfs(e[i].to);
    }
}
int LCA(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  int tmp = dep[x] - dep[y];
  for (int i = (int)(17); i >= (int)(0); i--)
    if (tmp & (1 << i)) x = fa[x][i];
  for (int i = (int)(17); i >= (int)(0); i--)
    if (fa[x][i] != fa[y][i]) x = fa[x][i], y = fa[y][i];
  return x == y ? x : fa[x][0];
}
int dis(int x, int y) { return dep[x] + dep[y] - 2 * dep[LCA(x, y)]; }
int Mx(int x, int y) { return dep[x] > dep[y] ? x : y; }
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
void exgcd(int x, int y, long long &a, long long &b) {
  if (!y) {
    a = 1, b = 0;
    return;
  }
  exgcd(y, x % y, b, a);
  b -= x / y * a;
}
long long SAME(int a, int b, int c, int d) {
  c -= a;
  long long k, p;
  int G = gcd(b, d);
  exgcd(b, d, k, p);
  if (c % G) return (1ll << 39);
  k *= c / G, p *= -(c / G);
  long long ad = d / G, ab = b / G;
  if (k < 0) {
    long long ti = max((-k - 1) / ad + 1, (-p - 1) / ab + 1);
    k += ad * ti;
    p += ab * ti;
  }
  long long ti = min(k / ad, p / ab);
  k -= ad * ti, p -= ab * ti;
  return b * k + a;
}
long long leiGCD(long long L, long long D, long long R, long long P) {
  if (!L) return 0;
  if (!D) return (1ll << 39);
  if (2 * D > P) return leiGCD(P - R, P - D, P - L, P);
  if ((L - 1) / D < R / D) return (L + D - 1) / D;
  long long tmp = leiGCD(L % D, D - P % D, R % D, D);
  return tmp == (1ll << 39) ? (1ll << 39) : (tmp * P + L + D - 1) / D;
}
long long DIFF(long long t1, long long f1, long long t4, long long f2,
               long long d) {
  if ((d + t1 + t4) & 1) return (1ll << 39);
  int l = ((t4 - t1 - d) % f2 + f2) % f2;
  int r = ((t4 - t1 + d) % f2 + f2) % f2;
  long long tmp = 0;
  if (f2 != 2 * d && l <= r && l)
    if ((l - 1) / gcd(f1, f2) >= r / gcd(f1, f2))
      tmp = (1ll << 39);
    else
      tmp = leiGCD(l, f1 % f2, r, f2);
  long long q = (tmp * f1 + t1 + d - t4) / f2;
  return (d + tmp * f1 + q * f2 + t1 + t4) / 2;
}
void solve() {
  int u, v, x, y;
  scanf("%d%d%d%d", &u, &v, &x, &y);
  int L1 = Mx(LCA(u, x), LCA(u, y));
  int L2 = Mx(LCA(v, x), LCA(v, y));
  int p = Mx(LCA(u, v), LCA(x, y));
  if (dep[L1] < dep[p] && dep[L2] < dep[p]) {
    puts("-1");
    return;
  }
  L1 = Mx(L1, p);
  L2 = Mx(L2, p);
  int t1 = dis(L1, u), t2 = dis(L2, u);
  int t3 = dis(L1, x), t4 = dis(L2, x);
  int f1 = dis(u, v) * 2, f2 = dis(x, y) * 2;
  int d = dis(L1, L2);
  if (t1 > t2)
    t1 = f1 - t1;
  else
    t2 = f1 - t2;
  if (t3 > t4)
    t3 = f2 - t3;
  else
    t4 = f2 - t4;
  long long ans = (1ll << 39);
  ans = min(ans, SAME(t1, f1, t3, f2));
  ans = min(ans, SAME(t2, f1, t4, f2));
  ans = min(ans, DIFF(t1, f1, t4, f2, d));
  ans = min(ans, DIFF(t2, f1, t3, f2, d));
  printf("%lld\n", ans == (1ll << 39) ? -1 : ans);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  dfs(1);
  for (int i = (int)(1); i <= (int)(17); i++)
    for (int j = (int)(1); j <= (int)(n); j++)
      fa[j][i] = fa[fa[j][i - 1]][i - 1];
  int Q;
  scanf("%d", &Q);
  while (Q--) solve();
}