#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long hsh1 = 1610612741;
const long long p1 = 37;
const long long hsh2 = 805306457;
const long long p2 = 31;
const int mxN = 300010;
const int lg = 20;
string s;
vector<int> g[mxN];
int par[mxN][lg];
int h[mxN];
long long hsh[mxN][lg];
long long rhsh[mxN][lg];
long long pw1[mxN], pw2[mxN];
long long comb(const long long h1, const long long h2, const int len) {
  long long fs = h1 >> 32, sc = h1 & ((1ll << 32) - 1);
  long long fs2 = h2 >> 32, sc2 = h2 & ((1ll << 32) - 1);
  fs = (fs + fs2 * pw1[len]) % hsh1;
  sc = (sc + sc2 * pw2[len]) % hsh2;
  return (fs << 32) + sc;
}
void dfs(const int v = 0, const int p = -1) {
  h[v] = (p == -1 ? 0 : h[p] + 1);
  par[v][0] = p;
  hsh[v][0] = rhsh[v][0] = ((1ll * (s[v] - 'a' + 1)) << 32 | (s[v] - 'a' + 1));
  for (int i = 1; par[v][i - 1] != -1; i++) {
    par[v][i] = par[par[v][i - 1]][i - 1];
    hsh[v][i] = comb(hsh[v][i - 1], hsh[par[v][i - 1]][i - 1], (1 << (i - 1)));
    rhsh[v][i] =
        comb(rhsh[par[v][i - 1]][i - 1], rhsh[v][i - 1], (1 << (i - 1)));
  }
  for (auto u : g[v]) {
    if (u != p) dfs(u, v);
  }
}
int lca(int u, int v) {
  if (h[u] > h[v]) swap(u, v);
  for (int i = lg - 1; i >= 0; i--) {
    if (par[v][i] != -1 && h[par[v][i]] >= h[u]) v = par[v][i];
  }
  if (u == v) return u;
  for (int i = lg - 1; i >= 0; i--) {
    if (par[v][i] != par[u][i]) v = par[v][i], u = par[u][i];
  }
  return par[v][0];
}
int getK(int v, const int k) {
  for (int i = 0; (1 << i) <= k; i++)
    if (k & (1 << i)) v = par[v][i];
  return v;
}
int getLCP(int a, int b, int len, bool r1, bool r2) {
  if (len == 0) return 0;
  int sofar = 0;
  for (int i = lg - 1; i >= 0; i--) {
    if (sofar + (1 << i) > len) continue;
    int v1 = a;
    if (r1) v1 = getK(a, len - sofar - (1 << i));
    int v2 = b;
    if (r2) v2 = getK(b, len - sofar - (1 << i));
    if ((r1 ? rhsh : hsh)[v1][i] == (r2 ? rhsh : hsh)[v2][i]) {
      if (!r1) a = par[a][i];
      if (!r2) b = par[b][i];
      sofar += (1 << i);
    }
  }
  return sofar;
}
int solve(int a, int b, int c, int d) {
  int l1 = lca(a, b), l2 = lca(c, d);
  if (h[a] - h[l1] < h[c] - h[l2]) {
    swap(a, c), swap(b, d), swap(l1, l2);
  }
  int d1 = h[a] - h[l1], d2 = h[c] - h[l2];
  int res = 0, cur = 0;
  cur = getLCP(a, c, d2, false, false);
  res = cur;
  if (cur != d2) return res;
  a = getK(a, d2);
  d1 = h[a] - h[l1] + 1;
  d2 = h[d] - h[l2] + 1;
  if (d1 >= d2) return res + getLCP(a, d, d2, false, true);
  c = getK(d, d2 - d1);
  cur = getLCP(a, c, d1, false, true);
  res += cur;
  if (cur != d1) return res;
  d2 = h[d] - h[c];
  d1 = h[b] - h[l1];
  if (d1 >= d2)
    b = getK(b, d1 - d2);
  else
    d = getK(d, d2 - d1);
  return res + getLCP(b, d, min(d1, d2), true, true);
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  memset(par, -1, sizeof par);
  pw1[0] = pw2[0] = 1;
  for (int i = 1; i < mxN; i++)
    pw1[i] = p1 * pw1[i - 1] % hsh1, pw2[i] = p2 * pw2[i - 1] % hsh2;
  int N, M, u, v, a, b;
  cin >> N >> s;
  for (int i = 1; i < N; i++) {
    cin >> u >> v;
    u--, v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs();
  cin >> M;
  while (M--) {
    cin >> u >> v >> a >> b;
    u--, v--, a--, b--;
    cout << solve(u, v, a, b) << '\n';
  }
  return 0;
}
