#include <bits/stdc++.h>
using namespace std;
int read() {
  int s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * t;
}
struct node {
  int len, hs1, hs2;
  node() {}
  node(int _l, int _h1, int _h2) { len = _l, hs1 = _h1, hs2 = _h2; }
} up[300100], dn[300100];
int b1[300100], b2[300100], n;
node operator+(node a, node b) {
  return node(a.len + b.len,
              (1ll * a.hs1 * b1[b.len] % 20040409 + b.hs1) % 20040409,
              (1ll * a.hs2 * b2[b.len] % 1000000007 + b.hs2) % 1000000007);
}
node operator-(node a, node b) {
  return node(
      a.len - b.len,
      (a.hs1 + 20040409 - 1ll * b1[a.len - b.len] * b.hs1 % 20040409) %
          20040409,
      (a.hs2 + 1000000007 - 1ll * b2[a.len - b.len] * b.hs2 % 1000000007) %
          1000000007);
}
bool operator==(node a, node b) {
  return a.len == b.len && a.hs1 == b.hs1 && a.hs2 == b.hs2;
}
struct edge {
  int to, lt;
} e[300100 << 1];
int in[300100], fa[300100], dep[300100], cnt, sz[300100], dfn[300100],
    idfn[300100], son[300100], top[300100], tms;
char ch[300100];
vector<pair<int, int> > u, v;
void add(int x, int y) {
  e[++cnt].to = y;
  e[cnt].lt = in[x];
  in[x] = cnt;
  e[++cnt].to = x;
  e[cnt].lt = in[y];
  in[y] = cnt;
}
void dfs(int x, int fr) {
  sz[x] = 1;
  fa[x] = fr;
  dep[x] = dep[fr] + 1;
  for (int i = in[x]; i; i = e[i].lt) {
    int y = e[i].to;
    if (y == fr) continue;
    dfs(y, x);
    sz[x] += sz[y];
    if (sz[y] > sz[son[x]]) son[x] = y;
  }
}
void dfs2(int x, int t) {
  top[x] = t;
  dfn[x] = ++tms;
  idfn[tms] = x;
  top[x] = t;
  if (!son[x]) return;
  dfs2(son[x], t);
  for (int i = in[x]; i; i = e[i].lt)
    if (e[i].to != fa[x] && e[i].to != son[x]) dfs2(e[i].to, e[i].to);
}
int LCA(int x, int y) {
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    x = fa[top[x]];
  }
  return dep[x] < dep[y] ? x : y;
}
vector<pair<int, int> > query(int s, int t) {
  int lca = LCA(s, t), x = s, y = t;
  vector<pair<int, int> > a, b;
  while (dep[top[x]] > dep[lca])
    a.push_back(make_pair(x, top[x])), x = fa[top[x]];
  a.push_back(make_pair(x, lca));
  while (dep[top[y]] > dep[lca])
    b.push_back(make_pair(top[y], y)), y = fa[top[y]];
  if (y != lca) b.push_back(make_pair(son[lca], y));
  while (b.size()) a.push_back(b.back()), b.pop_back();
  return a;
}
node Query(int x, int len) {
  if (len < 0) return up[x] - up[x + len];
  return dn[x] - dn[x + len];
}
int main() {
  n = read();
  scanf("%s", ch + 1);
  for (int i = 1; i < n; i++) add(read(), read());
  b1[0] = b2[0] = 1;
  for (int i = 1; i <= n; i++)
    b1[i] = 1ll * b1[i - 1] * 31 % 20040409,
    b2[i] = 1ll * b2[i - 1] * 37 % 1000000007;
  dfs(1, 0);
  dfs2(1, 1);
  for (int i = 1; i <= n; i++)
    up[i] = up[i - 1] + node(1, ch[idfn[i]] - 'a' + 1, ch[idfn[i]] - 'a' + 1);
  for (int i = n; i; i--)
    dn[i] = dn[i + 1] + node(1, ch[idfn[i]] - 'a' + 1, ch[idfn[i]] - 'a' + 1);
  int m = read();
  while (m--) {
    int a = read(), b = read(), c = read(), d = read();
    u = query(a, b);
    v = query(c, d);
    int p1 = 0, p2 = 0, ans = 0;
    while (p1 < u.size() && p2 < v.size()) {
      pair<int, int> p = u[p1], q = v[p2];
      int x1 = dfn[p.first], y1 = dfn[p.second], x2 = dfn[q.first],
          y2 = dfn[q.second];
      int len = min(abs(y1 - x1), abs(y2 - x2)) + 1;
      bool u1 = y1 > x1, u2 = y2 > x2;
      node A = Query(x1, u1 ? len : -len), B = Query(x2, u2 ? len : -len);
      if (A == B) {
        if (len == abs(y1 - x1) + 1)
          p1++;
        else
          u[p1].first = idfn[x1 + (u1 ? len : -len)];
        if (len == abs(y2 - x2) + 1)
          p2++;
        else
          v[p2].first = idfn[x2 + (u2 ? len : -len)];
        ans += len;
      } else {
        int l = 1, r = len, owo = 0;
        while (l <= r) {
          int mid = l + r >> 1;
          if (Query(x1, u1 ? mid : -mid) == Query(x2, u2 ? mid : -mid))
            l = mid + 1, owo = mid;
          else
            r = mid - 1;
        }
        ans += owo;
        break;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
