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;
template <typename TP>
inline void read(TP &tar) {
  TP ret = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ret = ret * 10 + (ch - '0');
    ch = getchar();
  }
  tar = ret * f;
}
template <typename TP, typename... Args>
inline void read(TP &t, Args &...args) {
  read(t), read(args...);
}
namespace RKK {
const int N = 200011;
const long long linf = 0x3f3f3f3f3f3f3f3f;
struct sumireko {
  int to, ne;
} e[N << 1];
int he[N], ecnt;
void addline(int f, int t) {
  e[++ecnt].to = t;
  e[ecnt].ne = he[f], he[f] = ecnt;
}
int n, qaq, log[N << 1];
int fa[N], dep[N];
int es[N], ea, ex[N << 1][20];
int spmin(const int &a, const int &b) { return dep[a] < dep[b] ? a : b; }
int spmax(const int &a, const int &b) { return dep[a] > dep[b] ? a : b; }
void dfs(int x) {
  ex[es[x] = ++ea][0] = x;
  for (int i = he[x], t = e[i].to; i; i = e[i].ne, t = e[i].to)
    if (t != fa[x]) fa[t] = x, dep[t] = dep[x] + 1, dfs(t), ex[++ea][0] = x;
}
int lca(int x, int y) {
  x = es[x], y = es[y];
  if (x > y) swap(x, y);
  int k = log[y - x + 1];
  return spmin(ex[x][k], ex[y - (1 << k) + 1][k]);
}
int dis(int x, int y) { return dep[x] + dep[y] - 2 * dep[lca(x, y)]; }
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) return (void)(x = 1, y = 0);
  exgcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - a / b * x;
}
long long calc1(long long a1, long long a2, long long b1, long long b2) {
  long long x = 1, y = 0, d = b2 - b1, g = gcd(a1, a2), t;
  if (d % g) return linf;
  exgcd(a1, a2, x, y);
  x *= d / g, y *= -d / g, a1 /= g, a2 /= g;
  if (x < 0)
    t = max(-(x + 1) / a2 + 1, -(y + 1) / a1 + 1), x += a2 * t, y += a1 * t;
  t = min(x / a2, y / a1), x -= a2 * t, y += a1 * t;
  return a1 * g * x + b1;
}
long long get(long long a, long long mo, long long l, long long r) {
  if ((l - 1) / a != r / a) return (l - 1 + a) / a;
  if (a * 2 > mo) return get(mo - a, mo, mo - r, mo - l);
  return (mo * get(a - mo % a, a, l % a, r % a) + (l - 1 + a)) / a;
}
long long calc2(long long a1, long long a2, long long b1, long long b2,
                long long d) {
  long long l = ((b2 - b1 - d) % a2 + a2) % a2;
  long long r = ((b2 - b1 + d) % a2 + a2) % a2;
  if (l & 1ll) return linf;
  long long t = 0;
  if (a2 != d + d && l <= r && l) {
    if ((l - 1) / gcd(a1, a2) >= r / gcd(a1, a2)) return linf;
    t = get(a1 % a2, a2, l, r);
  }
  long long s = (t * a1 + b1 - b2 + d) / a2;
  return (a1 * t + a2 * s + b1 + b2 + d) / 2;
}
long long solve(int x1, int y1, int x2, int y2) {
  int z1 = lca(x1, y1), z2 = lca(x2, y2);
  if (dep[z1] > dep[z2]) swap(x1, x2), swap(y1, y2), swap(z1, z2);
  if (lca(z1, z2) != z1 && lca(z1, z2) != z2) return -1ll;
  int w1 = spmax(lca(x1, x2), lca(x1, y2)),
      w2 = spmax(lca(y1, x2), lca(y1, y2));
  if (max(dep[w1], dep[w2]) < dep[z2]) return -1ll;
  w1 = spmax(w1, z2), w2 = spmax(w2, z2);
  int l1 = 2 * dis(x1, y1), l2 = 2 * dis(x2, y2);
  int t1 = dis(x1, w1), t2 = dis(x1, w2);
  t1 > t2 ? t1 = l1 - t1 : t2 = l1 - t2;
  int t3 = dis(x2, w1), t4 = dis(x2, w2);
  t3 > t4 ? t3 = l2 - t3 : t4 = l2 - t4;
  int d = dis(w1, w2);
  long long ans = min(min(calc1(l1, l2, t1, t3), calc1(l1, l2, t2, t4)),
                      min(calc2(l1, l2, t1, t4, d), calc2(l1, l2, t2, t3, d)));
  return ans == linf ? -1ll : ans;
}
int main() {
  read(n);
  for (int i = 2, x, y; i <= n; i++) read(x, y), addline(x, y), addline(y, x);
  dfs(1);
  for (int i = 2; i <= ea; i++) log[i] = log[i >> 1] + 1;
  for (int k = 1; k <= log[ea]; k++)
    for (int i = 1; i + (1 << k) - 1 <= ea; i++)
      ex[i][k] = spmin(ex[i][k - 1], ex[i + (1 << (k - 1))][k - 1]);
  read(qaq);
  for (int rkk = 1, x1, y1, x2, y2; rkk <= qaq; rkk++) {
    read(x1), read(y1), read(x2), read(y2);
    printf("%lld\n", solve(x1, y1, x2, y2));
  }
  return 0;
}
}  // namespace RKK
int main() { return RKK::main(); }