#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, res = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0', c = getchar();
  }
  return f * res;
}
const int maxn = 2e5 + 5;
char c[maxn];
int a[27], p[maxn], n, m, t, s[maxn][27];
int main() {
  t = read();
  while (t--) {
    n = read();
    m = read();
    scanf("%s", c + 1);
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < 26; j++) s[i][j] = s[i - 1][j];
      s[i][c[i] - 'a']++;
    }
    for (int i = 1; i <= m; i++) {
      p[i] = read();
      for (int j = 0; j < 26; j++) {
        a[j] += s[p[i]][j];
      }
    }
    for (int i = 0; i < 26; i++) a[i] += s[n][i];
    for (int i = 0; i < 26; i++) {
      printf("%d ", a[i]);
      a[i] = 0;
    }
    printf("\n");
  }
  return 0;
}
