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, L = 18;
const long long INF = 9e18;
int n, q, dep[N], fa[N][L];
int head[N], numE = 0;
char buf[1 << 23], *p1 = buf, *p2 = buf, obuf[1 << 23], *O = obuf;
struct E {
  int next, v;
} e[N << 1];
void inline read(int &x) {
  x = 0;
  char s =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
           ? EOF
           : *p1++);
  while (s > '9' || s < '0')
    s = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
  while (s <= '9' && s >= '0')
    x = (x << 1) + (x << 3) + s - '0',
    s = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
}
void inline add(int u, int v) {
  e[++numE] = (E){head[u], v};
  head[u] = numE;
}
void dfs(int u) {
  for (int i = 1; i < L && fa[u][i - 1]; i++)
    fa[u][i] = fa[fa[u][i - 1]][i - 1];
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].v;
    if (v == fa[u][0]) continue;
    fa[v][0] = u, dep[v] = dep[u] + 1;
    dfs(v);
  }
}
int inline lca(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  for (int i = L - 1; ~i; i--)
    if (dep[x] - (1 << i) >= dep[y]) x = fa[x][i];
  if (x == y) return x;
  for (int i = L - 1; ~i; i--)
    if (fa[x][i] != fa[y][i]) x = fa[x][i], y = fa[y][i];
  return fa[x][0];
}
int inline d(int x, int y, int p) { return dep[x] + dep[y] - 2 * dep[p]; }
long long exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  long long d = exgcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
long long inline work1(long long a, long long b, long long T1, long long T2) {
  long long x, y, c = T2 - T1, D1 = a;
  long long d = exgcd(a, b, x, y);
  if (c % d) return INF;
  x *= c / d, y *= -c / d;
  a /= d, b /= d;
  if (x < 0 || y < 0) {
    long long k = max((-x - 1) / b + 1, (-y - 1) / a + 1);
    x += k * b, y += k * a;
  }
  long long k = min(x / b, y / a);
  x -= k * b;
  return x * D1 + T1;
}
long long G(long long L, long long R, long long D, long long P) {
  if (!D) return INF;
  if (R / D * D >= L) return (L + D - 1) / D;
  long long x = G(((-R) % D + D) % D, ((-L) % D + D) % D, P % D, D);
  if (x == INF) return INF;
  return (x * P + L + D - 1) / D;
}
long long inline work2(long long D1, long long D2, long long T1, long long T2,
                       long long D) {
  if (D1 == 1 || D2 == 1) return INF;
  if ((D + T1 + T2) & 1) return INF;
  long long L = ((T2 - T1 - D) % D2 + D2) % D2,
            R = ((T2 - T1 + D) % D2 + D2) % D2;
  long long x1 = 0;
  if (L && L <= R && 2 * D < D2) x1 = G(L, R, D1 % D2, D2);
  if (x1 == INF) return INF;
  long long x2 = (x1 * D1 + T1 - T2 + D) / D2;
  if (x1 * D1 + T1 - T2 - D >= 0)
    x2 = min(x2, (x1 * D1 + T1 - T2 - D + D2 - 1) / D2);
  return (x1 * D1 + x2 * D2 + T1 + T2 + D) / 2;
}
long long inline query(int u, int v, int x, int y) {
  int p[4] = {lca(u, x), lca(u, y), lca(v, x), lca(v, y)};
  int w = lca(u, v), z = lca(x, y);
  int p1 = 0, p2 = 0;
  for (int i = 0; i < 4; i++)
    if (dep[p[i]] > dep[p1])
      p2 = p1, p1 = p[i];
    else if (dep[p[i]] > dep[p2])
      p2 = p[i];
  if (p1 == p2 && (dep[p1] < dep[w] || dep[p1] < dep[z])) return -1;
  int D1 = d(u, v, w) * 2, D2 = d(x, y, z) * 2, D = d(p1, p2, lca(p1, p2));
  int U1 = d(u, p1, lca(u, p1)), U2 = d(u, p2, lca(u, p2));
  if (U1 < U2)
    U2 = D1 - U2;
  else
    U1 = D1 - U1;
  int X1 = d(x, p1, lca(x, p1)), X2 = d(x, p2, lca(x, p2));
  if (X1 < X2)
    X2 = D2 - X2;
  else
    X1 = D2 - X1;
  if (D1 == 0) D1 = 1;
  if (D2 == 0) D2 = 1;
  long long res = min(work1(D1, D2, U1, X1), work1(D1, D2, U2, X2));
  res = min(res, min(work2(D1, D2, U1, X2, D), work2(D1, D2, U2, X1, D)));
  return res == INF ? -1 : res;
}
int main() {
  read(n);
  for (int i = 1, u, v; i < n; i++) read(u), read(v), add(u, v), add(v, u);
  dep[1] = 1, dfs(1);
  read(q);
  while (q--) {
    int u, v, x, y;
    read(u), read(v), read(x), read(y);
    printf("%lld\n", query(u, v, x, y));
  }
  return 0;
}