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;
vector<int> E[200010];
int n, Q;
int Dep[200010];
int par[18][200010];
void DFS(int node, int dep, int pp) {
  int i, x;
  Dep[node] = dep;
  par[0][node] = pp;
  for (i = 0; i < E[node].size(); i++) {
    x = E[node][i];
    if (x != pp) DFS(x, dep + 1, node);
  }
}
void make_List() {
  int i, j;
  for (i = 0; i < 17; i++) {
    for (j = 1; j <= n; j++) par[i + 1][j] = par[i][par[i][j]];
  }
}
int LCA(int u, int v) {
  if (Dep[u] < Dep[v]) return LCA(v, u);
  int d = Dep[u] - Dep[v], i = 0;
  while (d) {
    if (d & 1) u = par[i][u];
    d >>= 1;
    i++;
  }
  for (i = 17; i >= 0; i--) {
    if (par[i][u] != par[i][v]) u = par[i][u], v = par[i][v];
  }
  if (u != v) u = par[0][u];
  return u;
}
int Lower(int a, int b) {
  if (Dep[a] < Dep[b]) return b;
  return a;
}
int dist(int u, int v) {
  int L = LCA(u, v);
  return Dep[u] + Dep[v] - 2 * Dep[L];
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
long long First(long long M, long long D, long long g) {
  if (g == 0) return 0;
  long long T = First(D, M % D, g % D);
  T = (g - T * M) / D;
  if (T < 0) {
    T += (-T) / M * M;
    T += M;
  }
  return T % M;
}
long long SameDir(int T1, int d1, int T2, int d2, int L) {
  int g = gcd(T1, T2), M = d2 - d1;
  long long TT = T1;
  if (M < 0) M = T2 + M;
  if (M % g != 0) return 99999999999999999LL;
  T1 /= g, M /= g, T2 /= g;
  return First(T2, T1, M) * TT + d1;
}
int Gap(int M, int D, int L, int R) {
  D %= M;
  if (D * 2 > M) {
    return Gap(M, M - D, M - R, M - L);
  }
  int t = L / D, rr = M % D, q = M / D, o;
  long long a, b;
  if (L == t * D) return t;
  if (t * D + D <= R) return t + 1;
  a = Gap(D, D - rr, L % D, R % D);
  a = (a * M - 1) / D + 1;
  b = a * D % M;
  a += (R - b) / D;
  return a;
}
long long Do(int M, int D, int L, int R) {
  int Res = 99999999999999999LL;
  if (L == 0) {
    Res = M / gcd(M, D);
    L = 1;
  }
  if ((L - 1) / gcd(M, D) >= R / gcd(M, D)) {
    return 99999999999999999LL;
  }
  return min(Res, Gap(M, D, L, R));
}
long long DiffDir(int T1, int d1, int T2, int d2, int L) {
  int be = d2 - d1 - L, ed = d2 - d1 + L;
  long long P;
  if (be < 0) be += (-be) / T2 * T2;
  if (ed < 0) ed += (-ed) / T2 * T2;
  be = (be + T2) % T2, ed = (ed + T2) % T2;
  if (be & 1) return 99999999999999999LL;
  if (T2 == L * 2) {
    return d1 + ed / 2;
  }
  if (be > ed || be == 0) return d1 + ed / 2;
  P = Do(T2, T1, be, ed);
  if (P == 99999999999999999LL) return 99999999999999999LL;
  return T1 * P + d1 + L - (P * T1 % T2 - be) / 2;
}
long long Query(int u, int v, int x, int y) {
  int P1 = LCA(u, v), P2 = LCA(x, y), P3 = LCA(u, x), P4 = LCA(u, y),
      P5 = LCA(v, x), P6 = LCA(v, y);
  int pp, a, b, d1, d2, d3, d4, d5, d6, d;
  pp = Lower(P1, P2);
  a = Lower(P3, P4);
  b = Lower(P5, P6);
  if (Dep[a] < Dep[pp] && Dep[b] < Dep[pp]) return -1;
  if (Dep[a] < Dep[pp])
    a = pp;
  else if (Dep[b] < Dep[pp])
    b = pp;
  d1 = dist(u, v), d4 = dist(x, y);
  d2 = dist(u, a), d3 = dist(u, b);
  d5 = dist(x, a), d6 = dist(x, b);
  d = dist(a, b);
  if (d2 <= d3)
    d3 = d1 * 2 - d3;
  else
    d2 = d1 * 2 - d2;
  if (d5 <= d6)
    d6 = d4 * 2 - d6;
  else
    d5 = d4 * 2 - d5;
  long long Res = 99999999999999999LL;
  Res = min(SameDir(d1 * 2, d2, d4 * 2, d5, d), Res);
  Res = min(SameDir(d1 * 2, d3, d4 * 2, d6, d), Res);
  Res = min(DiffDir(d1 * 2, d2, d4 * 2, d6, d), Res);
  Res = min(DiffDir(d1 * 2, d3, d4 * 2, d5, d), Res);
  if (Res == 99999999999999999LL) return -1;
  return Res;
}
void Output() {
  int u, v, x, y, T;
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d%d%d%d", &u, &v, &x, &y);
    printf("%lld\n", Query(u, v, x, y));
  }
}
void input() {
  int i, a, b;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    E[a].push_back(b);
    E[b].push_back(a);
  }
}
int main() {
  input();
  DFS(1, 0, 0);
  make_List();
  Output();
}