#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
char s[N];
int m, n;
void sol() {
  int b[26] = {0};
  scanf("%d %d", &n, &m);
  int a[N] = {0};
  scanf("%s", s);
  int t;
  for (int i = 0; i < m; i++) {
    scanf("%d", &t);
    a[t - 1]++;
  }
  a[n - 1] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (i < n - 1) a[i] += a[i + 1];
    int num = s[i] - 'a';
    b[num] += a[i];
  }
  for (int i = 0; i < 26; i++) {
    if (i != 25)
      printf("%d ", b[i]);
    else
      printf("%d\n", b[i]);
  }
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) sol();
  return 0;
}
