#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 500;
const int MX = (int)1 << 20;
vector<int> g[N];
int n, sz[N];
long long ans[N], cnt[MX];
char c[N];
bool used[N];
void sizes(int v, int p) {
  sz[v] = 1;
  for (auto u : g[v]) {
    if (u == p || used[u]) continue;
    sizes(u, v);
    sz[v] += sz[u];
  }
}
int centroid(int v, int p, int sz_comp) {
  for (auto u : g[v])
    if (u != p && !used[u] && sz[u] > sz_comp / 2)
      return centroid(u, v, sz_comp);
  return v;
}
void upd(int v, int p, int k, int sum) {
  sum ^= (1 << (c[v] - 'a'));
  cnt[sum] += k;
  for (auto u : g[v]) {
    if (u == p || used[u]) continue;
    upd(u, v, k, sum);
  }
}
long long calc(int v, int p, int sum) {
  sum ^= (1 << (c[v] - 'a'));
  long long res = cnt[sum];
  for (int i = 0; i < 20; i++) res += cnt[sum ^ (1 << i)];
  for (auto u : g[v]) {
    if (u == p || used[u]) continue;
    res += calc(u, v, sum);
  }
  ans[v] += res;
  return res;
}
void solve(int v) {
  sizes(v, v);
  upd(v, v, 1, (1 << (c[v] - 'a')));
  long long res = cnt[(1 << (c[v] - 'a'))];
  for (int i = 0; i < 20; i++) res += cnt[(1 << (c[v] - 'a')) ^ (1 << i)];
  for (auto u : g[v]) {
    if (used[u]) continue;
    upd(u, v, -1, 0);
    res += calc(u, v, (1 << (c[v] - 'a')));
    upd(u, v, 1, 0);
  }
  upd(v, v, -1, (1 << (c[v] - 'a')));
  ans[v] += res / 2 + 1;
  used[v] = 1;
  for (auto u : g[v])
    if (!used[u]) solve(centroid(u, v, sz[u]));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  scanf("%s", c + 1);
  solve(1);
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
}
