#include <bits/stdc++.h>
using namespace std;
int sa[2 * 300006], lcp[2 * 300006];
char T[2 * 300006];
int n;
pair<pair<int, int>, int> p[2 * 300006];
bool mark[2 * 300006];
int key[2 * 300006];
char a[300006];
int deg[300006];
vector<int> g[300006];
int read() {
  char u;
  int v = 0;
  while (1) {
    u = getchar();
    if (u >= '0' && u <= '9') {
      v = u - '0';
      break;
    }
  }
  while (1) {
    u = getchar();
    if (u >= '0' && u <= '9')
      v = v * 10 + u - '0';
    else
      break;
  }
  return v;
}
void doc() {
  n = read();
  scanf("\n");
  gets(a + 1);
  scanf("\n");
  int u, v;
  for (int i = 1; i < n; i++) {
    u = read();
    v = read();
    deg[u]++;
    deg[v]++;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
int x[300006], cl[300006], cnt[300006], child[300006], pre[300006],
    slx = 0, head[300006], xhlt[300006], dhlt[300006], depth[300006],
    pos[300006];
void HLT() {
  int L = 1, R = 0;
  x[++R] = 1;
  cl[1] = 1;
  depth[1] = pre[1] = 0;
  while (L <= R) {
    int u = x[L++];
    for (int j = 0; j < deg[u]; j++) {
      int v = g[u][j];
      if (cl[v] == 0) {
        cl[v] = 1;
        pre[v] = u;
        depth[v] = depth[u] + 1;
        x[++R] = v;
      }
    }
  }
  for (int i = n; i >= 1; i--) {
    int u = x[i], slmax = 0;
    cnt[u] = 1;
    for (int j = 0; j < deg[u]; j++) {
      int v = g[u][j];
      if (pre[v] == u) {
        cnt[u] += cnt[v];
        if (cnt[v] > slmax) slmax = cnt[v], child[u] = v;
      }
    }
    if (slmax * 2 < cnt[u]) child[u] = 0;
  }
  int m = 0;
  for (int i = 1; i <= n; i++) {
    int u = x[i];
    if (child[pre[u]] != u || u == 1) {
      head[u] = u;
      xhlt[++m] = u;
      pos[u] = m;
      int v = u;
      while (child[v] != 0) {
        v = child[v];
        xhlt[++m] = v;
        pos[v] = m;
        head[v] = u;
      }
    }
  }
  dhlt[1] = 0;
  for (int i = 1; i <= n; i++) {
    int u = x[i];
    for (int j = 0; j < deg[u]; j++) {
      int v = g[u][j];
      if (v != child[u] && pre[v] == u) dhlt[head[v]] = dhlt[head[u]] + 1;
    }
  }
  for (int i = 1; i <= n; i++) T[i] = a[xhlt[i]];
  for (int i = 1; i <= n; i++) T[i + n] = a[xhlt[n - i + 1]];
}
void initsuff() {
  for (int i = 1; i <= 2 * n; ++i)
    p[i] = pair<pair<int, int>, int>(pair<int, int>(T[i], 0), i);
  sort(p + 1, p + 2 * n + 1);
  mark[1] = true;
  for (int i = 2; i <= 2 * n; ++i) mark[i] = (p[i].first != p[i - 1].first);
  for (int i = 1; i <= 2 * n; ++i) sa[i] = p[i].second;
}
void SA() {
  for (int k = 1; k * 2 < 2 * n; k *= 2) {
    int val = 0;
    for (int i = 1; i <= 2 * n; ++i) {
      if (mark[i]) ++val;
      key[sa[i]] = val;
    }
    if (val == n) break;
    for (int i = 1; i <= 2 * n; ++i) {
      int t = (i + k <= 2 * n) ? key[i + k] : 0;
      p[i] = pair<pair<int, int>, int>(pair<int, int>(key[i], t), i);
    }
    sort(p + 1, p + 2 * n + 1);
    mark[1] = true;
    for (int i = 2; i <= 2 * n; ++i) mark[i] = (p[i].first != p[i - 1].first);
    for (int i = 1; i <= 2 * n; ++i) sa[i] = p[i].second;
  }
}
int rk[2 * 300006];
void LCP() {
  for (int i = 1; i <= 2 * n; ++i) rk[sa[i]] = i;
  int q = 0;
  lcp[1] = 0;
  for (int i = 1; i <= 2 * n; ++i)
    if (rk[i] > 1) {
      int j = sa[rk[i] - 1];
      while (T[i + q] == T[j + q]) ++q;
      lcp[rk[i]] = q;
      q--;
      if (q < 0) q = 0;
    }
}
int f[2 * 300006][20];
pair<int, int> pa[100], pb[100];
int sla, slb;
void handling() {
  for (int i = 1; i <= 2 * n; ++i) f[i][0] = lcp[i];
  int k = log2(2 * n) + 1;
  for (int u = 1; u <= k; ++u)
    for (int i = 1; (i + (1 << u) - 1) <= 2 * n; i++)
      f[i][u] = min(f[i][u - 1], f[i + (1 << (u - 1))][u - 1]);
}
int tinh(int u, int v) {
  if (u > v) return 0;
  int k = (log2(v - u + 1));
  return min(f[u][k], f[v - (1 << k) + 1][k]);
}
int callcp(int u, int v, int l1, int l2) {
  if (u == v) return min(2 * n - u + 1, min(l1, l2));
  u = rk[u];
  v = rk[v];
  if (u > v) swap(u, v);
  int ds = tinh(u + 1, v);
  ds = min(ds, min(l1, l2));
  return ds;
}
void findpath(int u, int v) {
  sla = slb = 0;
  while (dhlt[head[u]] > dhlt[head[v]]) {
    pa[++sla] = pair<int, int>(2 * n - pos[u] + 1, pos[u] - pos[head[u]] + 1);
    u = pre[head[u]];
  }
  while (dhlt[head[v]] > dhlt[head[u]]) {
    pb[++slb] = pair<int, int>(pos[head[v]], pos[v] - pos[head[v]] + 1);
    v = pre[head[v]];
  }
  while (head[u] != head[v]) {
    pa[++sla] = pair<int, int>(2 * n - pos[u] + 1, pos[u] - pos[head[u]] + 1);
    u = pre[head[u]];
    pb[++slb] = pair<int, int>(pos[head[v]], pos[v] - pos[head[v]] + 1);
    v = pre[head[v]];
  }
  if (depth[u] > depth[v])
    pa[++sla] = pair<int, int>(2 * n - pos[u] + 1, pos[u] - pos[v] + 1);
  else
    pb[++slb] = pair<int, int>(pos[u], pos[v] - pos[u] + 1);
}
pair<int, int> p1[100], p2[100];
int sl1 = 0, sl2 = 0;
int query(int a, int b, int c, int d) {
  findpath(a, b);
  sl1 = 0, sl2 = 0;
  for (int i = 1; i <= sla; i++) p1[++sl1] = pa[i];
  for (int i = slb; i >= 1; i--) p1[++sl1] = pb[i];
  findpath(c, d);
  for (int i = 1; i <= sla; i++) p2[++sl2] = pa[i];
  for (int i = slb; i >= 1; i--) p2[++sl2] = pb[i];
  int u = 1, v = 1;
  int ds = 0;
  while (1) {
    int k = callcp(p1[u].first, p2[v].first, p1[u].second, p2[v].second);
    ds += k;
    if (k < p1[u].second && k < p2[v].second) break;
    if (k == p1[u].second && k < p2[v].second) {
      ++u;
      p2[v].first += k;
      p2[v].second -= k;
    } else if (k < p1[u].second && k == p2[v].second) {
      ++v;
      p1[u].first += k;
      p1[u].second -= k;
    } else if (k == p1[u].second && k == p2[v].second) {
      ++u;
      ++v;
    }
    if (u > sl1 || v > sl2) break;
  }
  return ds;
}
int tt;
int main() {
  doc();
  HLT();
  initsuff();
  SA();
  LCP();
  {
    handling();
    tt = read();
    int u, v, r, z;
    while (tt) {
      tt--;
      u = read();
      v = read();
      r = read();
      z = read();
      printf("%d\n", query(u, v, r, z));
    }
  }
}
