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;
using ll = long long;
const int N = 200005, L = 18;
int n, q, dep[N], fa[N][L];
vector<int> v[N];
void dfs(int pos) {
  for (int i = 1; i < L && fa[pos][i - 1]; i++)
    fa[pos][i] = fa[fa[pos][i - 1]][i - 1];
  for (auto &i : v[pos]) {
    if (i == fa[pos][0]) continue;
    fa[i][0] = pos;
    dep[i] = dep[pos] + 1;
    dfs(i);
  }
}
int lca(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  for (int i = L - 1; i >= 0; --i)
    if (dep[x] - (1 << i) >= dep[y]) x = fa[x][i];
  if (x == y) return x;
  for (int i = L - 1; i >= 0; --i)
    if (fa[x][i] != fa[y][i]) x = fa[x][i], y = fa[y][i];
  return fa[x][0];
}
inline int d(int x, int y) { return dep[x] + dep[y] - 2 * dep[lca(x, y)]; }
ll exgcd(ll a, ll b, ll &x, ll &y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  ll d = exgcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
inline ll work1(ll a, ll b, ll t1, ll t2) {
  ll x, y, c = t2 - t1, d1 = a, d = exgcd(a, b, x, y);
  if (c % d) return LLONG_MAX;
  x *= c / d;
  y *= -c / d;
  a /= d;
  b /= d;
  if (x < 0 || y < 0) {
    ll kk = max((-x - 1) / b + 1, (-y - 1) / a + 1);
    x += kk * b;
    y += kk * a;
  }
  ll kk = min(x / b, y / a);
  x -= kk * b;
  return x * d1 + t1;
}
ll g(ll l, ll r, ll d, ll p) {
  if (!d || l > r) return LLONG_MAX;
  if (r / d * d >= l) return (l + d - 1) / d;
  ll x = g(((-r) % d + d) % d, ((-l) % d + d) % d, p % d, d);
  if (x == LLONG_MAX) return LLONG_MAX;
  return (x * p + l + d - 1) / d;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll work2(ll d1, ll d2, ll t1, ll t2, ll d) {
  if ((d + t1 + t2) & 1) return LLONG_MAX;
  ll l = ((t2 - t1 - d) % d2 + d2) % d2, r = ((t2 - t1 + d) % d2 + d2) % d2,
     x1 = 0;
  if (l && d * 2 < d2 && l <= r) x1 = g(l, r, d1 % d2, d2);
  if (x1 == LLONG_MAX) return LLONG_MAX;
  ll x2 = (x1 * d1 + t1 - t2 + d) / d2;
  return (x1 * d1 + x2 * d2 + t1 + t2 + d) / 2;
}
ll 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) * 2, d2 = d(x, y) * 2, dd = d(p1, p2);
  int u1 = d(u, p1), u2 = d(u, p2);
  if (u1 < u2)
    u2 = d1 - u2;
  else
    u1 = d1 - u1;
  int x1 = d(x, p1), x2 = d(x, p2);
  if (x1 < x2)
    x2 = d2 - x2;
  else
    x1 = d2 - x1;
  ll ret = min(work1(d1, d2, u1, x1), work1(d1, d2, u2, x2));
  ret = min(ret, min(work2(d1, d2, u1, x2, dd), work2(d1, d2, u2, x1, dd)));
  return ret == LLONG_MAX ? -1 : ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  int t1, t2, t3, t4;
  for (int i = 1; i < n; i++)
    cin >> t1 >> t2, v[t1].push_back(t2), v[t2].push_back(t1);
  dep[1] = 1;
  dfs(1);
  cin >> q;
  while (q--) {
    cin >> t1 >> t2 >> t3 >> t4;
    cout << query(t1, t2, t3, t4) << endl;
  }
  return 0;
}