#include <bits/stdc++.h>
using namespace std;
template <unsigned int P>
struct Z {
  static unsigned int add(unsigned int a, unsigned int b) {
    if ((a += b) >= P) a -= P;
    return a;
  }
  static unsigned int sub(unsigned int a, unsigned int b) {
    if ((a += P - b) >= P) a -= P;
    return a;
  }
  static unsigned int mul(unsigned int a, unsigned int b) {
    return 1ull * a * b % P;
  }
};
const unsigned int M1 = 998244353, M2 = 1000000007;
struct P {
  unsigned int a, b;
  static P from(unsigned int v) { return {v, v}; }
  friend P operator+(P const& l, P const& r) {
    return {Z<M1>::add(l.a, r.a), Z<M2>::add(l.b, r.b)};
  }
  friend P operator-(P const& l, P const& r) {
    return {Z<M1>::sub(l.a, r.a), Z<M2>::sub(l.b, r.b)};
  }
  friend P operator*(P const& l, P const& r) {
    return {Z<M1>::mul(l.a, r.a), Z<M2>::mul(l.b, r.b)};
  }
  friend bool operator==(P const& l, P const& r) {
    return l.a == r.a && l.b == r.b;
  }
};
const P B{33, 41};
const int N = 3e5;
int n, m;
char c[N + 2];
vector<int> g[N + 1];
int f[N + 1], dep[N + 1], sz[N + 1], son[N + 1];
void dfs0(int u) {
  sz[u] = 1;
  for (int v : g[u]) {
    if (v == f[u]) continue;
    f[v] = u;
    dep[v] = dep[u] + 1;
    dfs0(v);
    sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) son[u] = v;
  }
}
int top[N + 1];
int cl, dfn[N + 1], nfd[N + 1];
void dfs1(int u, int t) {
  top[u] = t;
  ++cl;
  dfn[u] = cl;
  nfd[cl] = u;
  if (son[u]) dfs1(son[u], t);
  for (int v : g[u])
    if (v != f[u] && v != son[u]) dfs1(v, v);
}
int lca(int x, int y) {
  for (; top[x] != top[y]; y = f[top[y]])
    if (dep[top[x]] > dep[top[y]]) swap(x, y);
  if (dep[x] > dep[y]) swap(x, y);
  return x;
}
vector<pair<int, int> > path(int x, int y) {
  vector<pair<int, int> > u, d;
  int z = lca(x, y);
  for (; dep[top[x]] > dep[z]; x = f[top[x]]) u.emplace_back(x, top[x]);
  u.emplace_back(x, z);
  for (; dep[top[y]] > dep[z]; y = f[top[y]]) d.emplace_back(top[y], y);
  if (y != z) d.emplace_back(son[z], y);
  u.insert(u.end(), d.rbegin(), d.rend());
  return u;
}
P bpow[N + 1], h0[N + 2], h1[N + 2];
inline P geth(bool r, int p, int l) {
  return r ? h1[p - l + 1] - h1[p + 1] * bpow[l]
           : h0[p + l - 1] - h0[p - 1] * bpow[l];
}
int LCP(vector<pair<int, int> > A, vector<pair<int, int> > B) {
  auto a = A.begin(), b = B.begin();
  int lcp = 0;
  while (a != A.end() && b != B.end()) {
    int ab = dfn[a->first], ae = dfn[a->second], bb = dfn[b->first],
        be = dfn[b->second];
    bool ar = ab > ae, br = bb > be;
    int al = (ar ? ab - ae : ae - ab) + 1, bl = (br ? bb - be : be - bb) + 1,
        l = min(al, bl);
    if (geth(ar, ab, l) == geth(br, bb, l)) {
      if (l == al)
        ++a;
      else
        a->first = nfd[ab + (ar ? -l : l)];
      if (l == bl)
        ++b;
      else
        b->first = nfd[bb + (br ? -l : l)];
      lcp += l;
    } else {
      int L = 1, R = l, A = 0;
      while (L <= R) {
        int M = (L + R) >> 1;
        if (geth(ar, ab, M) == geth(br, bb, M)) {
          A = M;
          L = M + 1;
        } else
          R = M - 1;
      }
      lcp += A;
      break;
    }
  }
  return lcp;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> c + 1;
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs0(1);
  dfs1(1, 1);
  bpow[0] = P::from(1);
  for (int i = 1; i <= n; ++i) bpow[i] = bpow[i - 1] * B;
  for (int i = 1; i <= n; ++i) h0[i] = h0[i - 1] * B + P::from(c[nfd[i]] - 'a');
  for (int i = n; i >= 1; --i) h1[i] = h1[i + 1] * B + P::from(c[nfd[i]] - 'a');
  cin >> m;
  while (m--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << LCP(path(a, b), path(c, d)) << '\n';
  }
  return 0;
}
