#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chkmin(T &x, const T &y) {
  return x > y ? x = y, 1 : 0;
}
template <typename T>
bool chkmax(T &x, const T &y) {
  return x < y ? x = y, 1 : 0;
}
template <typename T>
T read() {
  T x = 0, f = 1;
  char c = getchar_unlocked();
  while ((c < '0') || (c > '9')) {
    if (c == '-') f = -1;
    c = getchar_unlocked();
  }
  while ((c >= '0') && (c <= '9'))
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar_unlocked();
  return x * f;
}
template <typename T>
void write(T x, char c) {
  static char t[25];
  static int tlen;
  t[tlen = 1] = c;
  if (x < 0) putchar_unlocked('-'), x = -x;
  do t[++tlen] = (x % 10) ^ 48;
  while (x /= 10);
  while (tlen) putchar_unlocked(t[tlen--]);
}
const int maxn = 200005;
int n, sz[maxn], mask[maxn];
char c[maxn];
vector<int> E[maxn];
int cnt[1 << 20];
bool vis[maxn];
long long ans[maxn], tmp[maxn];
void getsz(int u, int fa) {
  sz[u] = 1;
  for (int v : E[u]) {
    if ((vis[v]) || (v == fa)) continue;
    getsz(v, u), sz[u] += sz[v];
  }
}
int find_root(int u, int fa, int tot) {
  int Maxsz = tot - sz[u], res = 0;
  for (int v : E[u]) {
    if ((vis[v]) || (v == fa)) continue;
    res = find_root(v, u, tot);
    if (res) return res;
    chkmax(Maxsz, sz[v]);
  }
  return (Maxsz <= tot / 2) ? u : 0;
}
void dfs(int u, int fa, int Mask, int flag) {
  cnt[Mask] += flag;
  for (int v : E[u]) {
    if ((vis[v]) || (v == fa)) continue;
    dfs(v, u, Mask ^ mask[v], flag);
  }
}
void calc(int u, int fa, int Mask) {
  tmp[u] += cnt[Mask];
  for (int i = (int)(0), iend = (int)(19); i <= iend; ++i)
    tmp[u] += cnt[Mask ^ (1 << i)];
  for (int v : E[u]) {
    if ((vis[v]) || (v == fa)) continue;
    calc(v, u, Mask ^ mask[v]);
    tmp[u] += tmp[v];
  }
  ans[u] += tmp[u];
}
void clear(int u, int fa) {
  tmp[u] = 0;
  for (int v : E[u]) {
    if ((vis[v]) || (v == fa)) continue;
    clear(v, u);
  }
}
void solve(int u) {
  long long sum = 0;
  getsz(u, 0);
  u = find_root(u, 0, sz[u]);
  vis[u] = 1;
  dfs(u, 0, 0, 1);
  for (int v : E[u]) {
    if (vis[v]) continue;
    dfs(v, u, mask[v], -1);
    calc(v, u, mask[u] ^ mask[v]);
    dfs(v, u, mask[v], 1);
    sum += tmp[v];
  }
  sum += cnt[mask[u]] - 1;
  for (int i = (int)(0), iend = (int)(19); i <= iend; ++i)
    sum += cnt[mask[u] ^ (1 << i)];
  sum = sum / 2 + 1;
  ans[u] += sum;
  clear(u, 0);
  dfs(u, 0, 0, -1);
  for (int v : E[u])
    if (!vis[v]) solve(v);
}
int main() {
  int u, v;
  n = read<int>();
  for (int i = (int)(1), iend = (int)(n - 1); i <= iend; ++i) {
    u = read<int>(), v = read<int>();
    E[u].push_back(v), E[v].push_back(u);
  }
  scanf("%s", c + 1);
  for (int i = (int)(1), iend = (int)(n); i <= iend; ++i)
    mask[i] = 1 << (c[i] - 'a');
  solve(1);
  for (int i = (int)(1), iend = (int)(n); i <= iend; ++i)
    write(ans[i], i == n ? '\n' : ' ');
  return 0;
}
