#include <bits/stdc++.h>
const size_t IBUFSIZ = 1 << 24;
char ibuf[IBUFSIZ | 1];
const char *const ep = ibuf + IBUFSIZ;
const char *sp = ep - 1;
int _;
constexpr int BS = 521, P = 1073741789;
struct edge {
  int next, to;
} e[300010 << 1];
typedef int arr[300010];
int ei, cnt;
char c[300010];
arr head, siz, hson, top, dep, fa, dfn, seg, pre, suf, bs;
std::vector<std::pair<int, int>>::iterator it, jt;
template <const int P = ::P>
constexpr int fix(const int &x) {
  return x + ((x >> 31) & P);
}
void dfs1(const int &f) {
  dep[f] = dep[fa[f]] + 1;
  siz[f] = 1;
  for (int i = head[f]; i; i = e[i].next) {
    const int t = e[i].to;
    if (!siz[t]) {
      fa[t] = f;
      dfs1(t);
      if (siz[t] > siz[hson[f]]) hson[f] = t;
      siz[f] += siz[t];
    }
  }
}
void dfs2(const int &f) {
  dfn[f] = ++cnt;
  seg[cnt] = f;
  if (hson[f]) {
    top[hson[f]] = top[f];
    dfs2(hson[f]);
    for (int i = head[f]; i; i = e[i].next) {
      const int t = e[i].to;
      if (t != fa[f] && t != hson[f]) {
        top[t] = t;
        dfs2(t);
      }
    }
  }
}
void getpath(int x, int y, std::vector<std::pair<int, int>> &ans) {
  static std::vector<std::pair<int, int>> tmp;
  ans.clear();
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) {
      tmp.push_back(std::make_pair(top[y], y));
      y = fa[top[y]];
    } else {
      ans.push_back(std::make_pair(x, top[x]));
      x = fa[top[x]];
    }
  }
  ans.push_back(std::make_pair(x, y));
  while (!tmp.empty()) {
    ans.push_back(tmp.back());
    tmp.pop_back();
  }
}
inline int hash(const bool &r, const int &p, const int &l) {
  return r ? fix(suf[p - l + 1] - 1ll * suf[p + 1] * bs[l] % P)
           : fix(pre[p + l - 1] - 1ll * pre[p - 1] * bs[l] % P);
}
int main() {
  bs[0] = 1;
  const int n = ({
    while ((__builtin_expect(++sp == ep, false) &&
                (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
            *sp) < 48) {
    }
    _ = *sp ^ 48;
    while ((__builtin_expect(++sp == ep, false) &&
                (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
            *sp) >= 48)
      _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
    _;
  });
  for (int i = 1; i <= n; ++i) {
    c[i] = ({
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) <= 96) {
      }
      *sp;
    });
    bs[i] = 1ll * bs[i - 1] * BS % P;
  }
  for (int i = n; --i;) {
    const int x = ({
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) < 48) {
      }
      _ = *sp ^ 48;
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) >= 48)
        _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
      _;
    });
    const int y = ({
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) < 48) {
      }
      _ = *sp ^ 48;
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) >= 48)
        _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
      _;
    });
    (e[++ei].next = head[x], e[ei].to = (y), head[x] = ei);
    (e[++ei].next = head[y], e[ei].to = (x), head[y] = ei);
  }
  dfs1(1);
  top[1] = 1;
  dfs2(1);
  for (int i = 1; i <= n; ++i) pre[i] = (1ll * pre[i - 1] * BS + c[seg[i]]) % P;
  for (int i = n; i >= 1; --i) suf[i] = (1ll * suf[i + 1] * BS + c[seg[i]]) % P;
  for (int m = ({
         while ((__builtin_expect(++sp == ep, false) &&
                     (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
                 *sp) < 48) {
         }
         _ = *sp ^ 48;
         while ((__builtin_expect(++sp == ep, false) &&
                     (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
                 *sp) >= 48)
           _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
         _;
       });
       m--;) {
    int a = ({
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) < 48) {
      }
      _ = *sp ^ 48;
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) >= 48)
        _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
      _;
    });
    int b = ({
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) < 48) {
      }
      _ = *sp ^ 48;
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) >= 48)
        _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
      _;
    });
    int c = ({
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) < 48) {
      }
      _ = *sp ^ 48;
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) >= 48)
        _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
      _;
    });
    int d = ({
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) < 48) {
      }
      _ = *sp ^ 48;
      while ((__builtin_expect(++sp == ep, false) &&
                  (fread(ibuf, 1, IBUFSIZ, stdin), sp = ibuf),
              *sp) >= 48)
        _ = (((_ << 2) + _) << 1) + (*sp ^ 48);
      _;
    });
    int ans = 0;
    static std::vector<std::pair<int, int>> p1, p2;
    getpath(a, b, p1);
    getpath(c, d, p2);
    it = p1.begin();
    jt = p2.begin();
    while (it != p1.end() && jt != p2.end()) {
      const int f1 = dfn[it->first], t1 = dfn[it->second];
      const int f2 = dfn[jt->first], t2 = dfn[jt->second];
      const bool r1 = f1 > t1, r2 = f2 > t2;
      const int l1 = (r1 ? (f1 - t1) : (t1 - f1)) + 1;
      const int l2 = (r2 ? (f2 - t2) : (t2 - f2)) + 1;
      const int len = std::min(l1, l2);
      if (hash(r1, f1, len) != hash(r2, f2, len)) {
        int l = 0, r = len;
        while (l + 1 < r) {
          const int mid = (l + r) >> 1;
          if (hash(r1, f1, mid) != hash(r2, f2, mid)) {
            r = mid;
          } else {
            l = mid;
          }
        }
        ans += l;
        break;
      }
      if (len == l1) {
        ++it;
      } else {
        it->first = seg[f1 + (r1 ? -len : len)];
      }
      if (len == l2) {
        ++jt;
      } else {
        jt->first = seg[f2 + (r2 ? -len : len)];
      }
      ans += len;
    }
    printf("%d\n", ans);
  }
  return 0;
}
