#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 40;
const int N = 200005;
vector<int> e[N];
int n, tot, dep[N], fa[N][20];
void dfs(int x) {
  for (auto i : e[x])
    if (i != fa[x][0]) {
      fa[i][0] = x;
      dep[i] = dep[x] + 1;
      dfs(i);
    }
}
int LCA(int x, int y) {
  if (dep[x] < dep[y]) swap(x, y);
  int tmp = dep[x] - dep[y];
  for (int i = (int)(17); i >= (int)(0); i--)
    if (tmp & (1 << i)) x = fa[x][i];
  for (int i = (int)(17); i >= (int)(0); i--)
    if (fa[x][i] != fa[y][i]) x = fa[x][i], y = fa[y][i];
  return x == y ? x : fa[x][0];
}
int dis(int x, int y) { return dep[x] + dep[y] - 2 * dep[LCA(x, y)]; }
int Mx(int x, int y) { return dep[x] > dep[y] ? x : y; }
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
void exgcd(int x, int y, long long &a, long long &b) {
  if (!y) {
    a = 1, b = 0;
    return;
  }
  exgcd(y, x % y, b, a);
  b -= x / y * a;
}
long long SAME(int a, int b, int c, int d) {
  c -= a;
  long long k, p;
  int G = gcd(b, d);
  exgcd(b, d, k, p);
  if (c % G) return INF;
  k *= c / G, p *= -(c / G);
  long long ad = d / G, ab = b / G;
  if (k < 0) {
    long long ti = max((-k - 1) / ad + 1, (-p - 1) / ab + 1);
    k += ad * ti;
    p += ab * ti;
  }
  long long ti = min(k / ad, p / ab);
  k -= ad * ti, p -= ab * ti;
  return b * k + a;
}
long long leiGCD(long long L, long long D, long long R, long long P) {
  if (!L) return 0;
  if (!D) return INF;
  if (2 * D > P) return leiGCD(P - R, P - D, P - L, P);
  if ((L - 1) / D < R / D) return (L + D - 1) / D;
  long long tmp = leiGCD(L % D, D - P % D, R % D, D);
  return tmp == INF ? INF : (tmp * P + L + D - 1) / D;
}
long long DIFF(long long t1, long long f1, long long t4, long long f2,
               long long d) {
  if ((d + t1 + t4) & 1) return INF;
  int l = ((t4 - t1 - d) % f2 + f2) % f2;
  int r = ((t4 - t1 + d) % f2 + f2) % f2;
  long long tmp = 0;
  if (f2 != 2 * d && l <= r && l)
    if ((l - 1) / gcd(f1, f2) >= r / gcd(f1, f2))
      tmp = INF;
    else
      tmp = leiGCD(l, f1 % f2, r, f2);
  long long q = (tmp * f1 + t1 + d - t4) / f2;
  return (d + tmp * f1 + q * f2 + t1 + t4) / 2;
}
void solve() {
  int u, v, x, y;
  scanf("%d%d%d%d", &u, &v, &x, &y);
  int L1 = Mx(LCA(u, x), LCA(u, y));
  int L2 = Mx(LCA(v, x), LCA(v, y));
  int p = Mx(LCA(u, v), LCA(x, y));
  if (dep[L1] < dep[p] && dep[L2] < dep[p]) return puts("-1"), void(0);
  L1 = Mx(L1, p);
  L2 = Mx(L2, p);
  int t1 = dis(L1, u), t2 = dis(L2, u);
  int t3 = dis(L1, x), t4 = dis(L2, x);
  int f1 = dis(u, v) * 2, f2 = dis(x, y) * 2;
  int d = dis(L1, L2);
  t1 > t2 ? t1 = f1 - t1 : t2 = f1 - t2;
  t3 > t4 ? t3 = f2 - t3 : t4 = f2 - t4;
  long long ans = INF;
  ans = min(ans, SAME(t1, f1, t3, f2));
  ans = min(ans, SAME(t2, f1, t4, f2));
  ans = min(ans, DIFF(t1, f1, t4, f2, d));
  ans = min(ans, DIFF(t2, f1, t3, f2, d));
  printf("%lld\n", ans == INF ? -1 : ans);
}
int main() {
  scanf("%d", &n);
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  dfs(1);
  for (int i = (int)(1); i <= (int)(17); i++)
    for (int j = (int)(1); j <= (int)(n); j++)
      fa[j][i] = fa[fa[j][i - 1]][i - 1];
  int Q;
  scanf("%d", &Q);
  while (Q--) solve();
}
