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 MAXN = 200005;
const long long Inf = 1LL << 40;
int To[MAXN * 2], Next[MAXN * 2], Final[MAXN];
int Deep[MAXN], Fa[20][MAXN], cnt, N, M, tot;
void Link(int u, int v) { To[++tot] = v, Next[tot] = Final[u], Final[u] = tot; }
void Dfs(int Now, int Pre) {
  Deep[Now] = Deep[Pre] + 1;
  Fa[0][Now] = Pre;
  for (int i = Final[Now]; i; i = Next[i])
    if (To[i] != Pre) Dfs(To[i], Now);
}
int LCA(int u, int v) {
  if (Deep[u] > Deep[v]) swap(u, v);
  for (int i = 19; i + 1; i--)
    if (Deep[Fa[i][v]] >= Deep[u]) v = Fa[i][v];
  if (u == v) return u;
  for (int i = 19; i + 1; i--)
    if (Fa[i][u] != Fa[i][v]) u = Fa[i][u], v = Fa[i][v];
  return Fa[0][u];
}
int Dis(int x, int y) { return Deep[x] + Deep[y] - 2 * Deep[LCA(x, y)]; }
int Cmax(int a, int b) { return Deep[a] > Deep[b] ? a : b; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int Gcd(int a, int b, long long &x, long long &y) {
  if (!b) {
    x = 1, y = 0;
    return a;
  }
  int Tmp = Gcd(b, a % b, x, y), x1 = x;
  x = y;
  y = x1 - a / b * y;
  return Tmp;
}
long long Same(int a, int b, int c, int d) {
  c -= a;
  long long k, p;
  int Tmp = Gcd(b, d, k, p), f = 0;
  if (c % Tmp) return Inf;
  k *= c / Tmp;
  p *= -c / Tmp;
  long long Ad = d / Tmp, Ab = b / Tmp;
  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 G(long long L, long long D, long long R, long long P) {
  if (!L) return 0;
  if (!D) return Inf;
  if (2 * D > P) return G(P - R, P - D, P - L, P);
  if ((L - 1) / D < R / D) return (L + D - 1) / D;
  long long Tmp = G(L % D, D - P % D, R % D, D);
  return Tmp == Inf ? Inf : (Tmp * P + L + D - 1) / D;
}
long long Diff(int t1, int f1, int t4, int f2, int d) {
  if ((d + t1 + t4) & 1) return Inf;
  int l = ((t4 - t1 - d) % f2 + f2) % f2, 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 = Inf;
    else
      tmp = G(l, f1 % f2, r, f2);
  }
  long long q = (tmp * f1 + t1 + d - t4) / f2;
  return (d + tmp * f1 + q * f2 + t1 + t4) / 2;
}
void Work() {
  int u, v, x, y;
  scanf("%d%d%d%d", &u, &v, &x, &y);
  int c1 = Cmax(LCA(u, x), LCA(u, y)), c2 = Cmax(LCA(v, x), LCA(v, y));
  int p = Cmax(LCA(u, v), LCA(x, y));
  if (Deep[c1] < Deep[p] && Deep[c2] < Deep[p]) {
    printf("-1\n");
    return;
  }
  c1 = Cmax(c1, p), c2 = Cmax(c2, p);
  int t1 = Dis(c1, u), t2 = Dis(c2, u), t3 = Dis(c1, x), t4 = Dis(c2, x),
      d = Dis(c1, c2);
  int f1 = Dis(u, v) * 2, f2 = Dis(x, y) * 2;
  if (t1 > t2)
    t1 = f1 - t1;
  else
    t2 = f1 - t2;
  if (t3 > t4)
    t3 = f2 - t3;
  else
    t4 = f2 - t4;
  long long Ans = Inf;
  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));
  if (Ans == Inf)
    printf("-1\n");
  else
    printf("%I64d\n", Ans);
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i < N; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    Link(u, v), Link(v, u);
  }
  Dfs(1, 0);
  for (int i = 1; i < 20; i++)
    for (int j = 1; j <= N; j++) Fa[i][j] = Fa[i - 1][Fa[i - 1][j]];
  scanf("%d", &M);
  for (; M; M--) Work();
  return 0;
}