#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int cnt[maxn][26];
char s[maxn];
int p[maxn], n, m, T;
long long ans[26];
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &n, &m);
    scanf("%s", s + 1);
    for (int i = 1; i <= n; i++)
      for (int j = 0; j < 26; j++) cnt[i][j] = 0;
    for (int i = 1; i <= n; i++) cnt[i][s[i] - 'a']++;
    for (int i = 1; i <= n; i++)
      for (int j = 0; j < 26; j++) cnt[i][j] += cnt[i - 1][j];
    memset(ans, 0, sizeof(ans));
    for (int i = 1, x; i <= m; i++) {
      scanf("%d", &x);
      for (int j = 0; j < 26; j++) ans[j] += cnt[x][j];
    }
    for (int i = 0; i < 26; i++) ans[i] += cnt[n][i];
    for (int i = 0; i < 26; i++) printf("%lld ", ans[i]);
    printf("\n");
  }
  return 0;
}
