#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int pal[25];
vector<int> g[N];
vector<int> comp[N];
int cnt[(1 << 21) + 1337];
bool used[N];
int let[N];
long long ans[N];
int f[30][N];
void init() {
  for (int i = 0; i < (N - 1); ++i) used[i] = 0;
  for (int i = 0; i < (N - 1); ++i) ans[i] = 0ll;
  for (int i = 0; i < (20); ++i) pal[i] = (1 << i);
  pal[20] = 0;
  for (int i = 0; i < ((1 << 21) + 333); ++i) cnt[i] = 0;
}
int find_center(int v, int scale, int &center, int p) {
  int sz = 1;
  for (auto u : g[v]) {
    if (u != p && !used[u]) {
      sz += find_center(u, scale, center, v);
    }
  }
  if (center == -1 && (scale <= sz + sz || p == -1)) {
    center = v;
  }
  return sz;
}
void dfs_cnt(int v, int p, int mask, int add) {
  mask ^= let[v];
  cnt[mask] += add;
  for (auto u : g[v]) {
    if (!used[u] && u != p) {
      dfs_cnt(u, v, mask, add);
    }
  }
}
long long dfs_calc(int v, int p, int mask, long long &d) {
  mask ^= let[v];
  long long new_path = 0;
  for (int pi = 0; pi < 21; ++pi) {
    int plnd = pal[pi];
    int need = plnd ^ mask;
    if (need == 0) ++d;
    new_path += cnt[need];
  }
  for (auto u : g[v]) {
    if (!used[u] && u != p) {
      new_path += dfs_calc(u, v, mask, d);
    }
  }
  ans[v] += new_path;
  return new_path;
}
void build(int v, int scale) {
  int c = -1;
  find_center(v, scale, c, -1);
  used[c] = true;
  cnt[0]++;
  for (auto u : g[c]) {
    if (!used[u]) {
      dfs_cnt(u, c, 0, 1);
    }
  }
  long long d = 0;
  for (auto u : g[c]) {
    if (!used[u]) {
      dfs_cnt(u, c, 0, -1);
      d += dfs_calc(u, c, let[c], d);
      dfs_cnt(u, c, 0, 1);
    }
  }
  ans[c] += d / 2;
  cnt[0]--;
  for (auto u : g[c]) {
    if (!used[u]) {
      dfs_cnt(u, c, 0, -1);
    }
  }
  for (auto u : g[c]) {
    if (!used[u]) {
      build(u, scale / 2 + scale % 2);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  init();
  int n;
  cin >> n;
  for (int i = 0; i < (n - 1); ++i) {
    int v, u;
    cin >> v >> u;
    --v, --u;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  string s;
  cin >> s;
  for (int i = 0; i < (n); ++i) {
    let[i] = (1 << (s[i] - 'a'));
  }
  build(0, n);
  for (int i = 0; i < n; ++i) cout << ans[i] + 1 << ' ';
  cout << '\n';
  return 0;
}
