#include <bits/stdc++.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
using pil = pair<int, lld>;
using pli = pair<lld, int>;
int n, m;
char a[200009];
int s[200009][26];
lld res[26];
int main() {
  int i, j, k, l;
  int t = 1, tv = 0;
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d", &n, &m);
    scanf("%s", a);
    for (i = 0; i < n; i++) {
      for (j = 0; j < 26; j++) {
        s[i + 1][j] = s[i][j];
      }
      s[i + 1][a[i] - 'a']++;
    }
    for (i = 0; i < 26; i++) {
      res[i] = s[n][i];
    }
    while (m--) {
      scanf("%d", &i);
      for (j = 0; j < 26; j++) {
        res[j] += s[i][j];
      }
    }
    for (i = 0; i < 26; i++) {
      printf("%lld ", res[i]);
    }
    printf("\n");
  }
}
