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 C>
void ma(C& a, C b) {
  if (a < b) a = b;
}
template <typename C>
void mi(C& a, C b) {
  if (a > b) a = b;
}
int n, q, v[200100][4], odl[200100][4][4];
vector<int> d[200100];
int gl[200100], f[200100];
vector<pair<int, int*> > zap[200100];
bool cz[200100];
void add_q(int a, int b, int* c) {
  zap[a].push_back(make_pair(b, c));
  zap[b].push_back(make_pair(a, c));
}
int find(int a) { return f[a] == a ? a : f[a] = find(f[a]); }
void dfs(int nr, int oj, int g) {
  gl[nr] = g++;
  cz[nr] = 1;
  for (int i = 0; i < zap[nr].size(); i++) {
    int ak = zap[nr][i].first;
    if (cz[ak]) {
      *(zap[nr][i].second) = gl[nr] + gl[ak] - 2 * gl[find(ak)];
    }
  }
  for (int i = 0; i < d[nr].size(); i++) {
    if (d[nr][i] == oj) continue;
    dfs(d[nr][i], nr, g);
    f[d[nr][i]] = nr;
  }
}
long long gcd(long long a, long long b, long long& x, long long& y) {
  if (a < b) return gcd(b, a, y, x);
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long xp;
  long long pom = gcd(b, a % b, xp, x);
  y = xp - x * (a / b);
  return pom;
}
long long d1, d2, q1, q2, c, cd, wyn, mod;
void licz(long long x, long long y) {
  if (x % cd != y % cd) return;
  long long res = x * d2 / cd * q2 + y * d1 / cd * q1;
  res %= mod;
  if (res < 0) res += mod;
  if (wyn == -1 || res < wyn) wyn = res;
}
void licz2(long long x, long long y, long long c) {
  long long diff = (y - x) % cd;
  if (diff < 0) diff += cd;
  if (diff & 1) return;
  diff /= 2;
  x += diff;
  y -= diff;
  c -= diff;
  if (c < 0) return;
  long long krok = cd / 2;
  c /= krok;
  long long res = x * d2 / cd * q2 + y * d1 / cd * q1;
  res %= mod;
  if (res < 0) res += mod;
  long long b = krok * d2 / cd * q2 - krok * d1 / cd * q1;
  b %= mod;
  if (b < 0) b += mod;
  long long a = mod - b;
  long long ca = 1;
  long long cb = 1;
  if (wyn == -1 || res < wyn) wyn = res;
  while (a != 0 && b != 0) {
    long long pom = max(0ll, min(c / cb, (a + b - res - 1) / b));
    c -= cb * pom;
    res += b * pom;
    pom = min(c / ca, res / a);
    c -= ca * pom;
    res -= a * pom;
    if (wyn == -1 || res < wyn) wyn = res;
    if (a > b) {
      ca += a / b * cb;
      a %= b;
    } else {
      cb += b / a * ca;
      b %= a;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    d[a].push_back(b);
    d[b].push_back(a);
  }
  for (int i = 0; i < n; i++) f[i] = i;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    for (int j = 0; j < 4; j++) {
      scanf("%d", &v[i][j]);
      v[i][j]--;
    }
    for (int j = 0; j < 4; j++)
      for (int k = j + 1; k < 4; k++) add_q(v[i][j], v[i][k], &odl[i][j][k]);
  }
  dfs(0, -1, 0);
  for (int i = 0; i < q; i++) {
    int(&od)[4][4] = odl[i];
    int t1 = od[0][1] + od[2][3] - od[0][2] - od[1][3];
    if (t1 < 0) {
      puts("-1");
      continue;
    }
    d1 = od[0][1] * 2;
    d2 = od[2][3] * 2;
    cd = gcd(d1, d2, q1, q2);
    mod = d1 / cd * d2;
    int t2 = od[0][1] + od[2][3] - od[0][3] - od[1][2];
    long long x = (od[0][2] + od[0][3] - od[2][3]) / 2;
    long long y = (od[0][2] + od[2][3] - od[0][3]) / 2;
    wyn = -1;
    if (t2 == 0) {
      c = t1 / 2;
      licz(x, y);
      licz(d1 - x - c, d2 - y - c);
      licz2(x, d2 - y, c);
      licz2(d1 - x - c, y + c, c);
    } else {
      c = t2 / 2;
      licz(x, d2 - y);
      licz(d1 - x - c, y - c);
      licz2(x, y, c);
      licz2(d1 - x - c, d2 - y + c, c);
    }
    printf("%lld\n", wyn);
  }
}