#include <bits/stdc++.h>
using namespace std;
char s[200001];
int a[200001], sum[26], b[26];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, m, i, j = 0, k;
    char p;
    memset(a, 0, sizeof(a));
    memset(sum, 0, sizeof(sum));
    memset(s, 0, sizeof(s));
    memset(b, 0, sizeof(b));
    scanf("%d %d", &n, &m);
    scanf("%c", &p);
    scanf("%s", s);
    for (i = 0; i < m; i++) scanf("%d", &a[i]);
    sort(a, a + m);
    for (i = 0; i < n; i++) {
      sum[s[i] - 'a']++;
      while (a[j] == (i + 1)) {
        for (k = 0; k < 26; k++) {
          b[k] += sum[k];
        }
        j++;
      }
    }
    for (i = 0; i < 26; i++) {
      sum[i] += b[i];
      printf("%d ", sum[i]);
    }
    printf("\n");
  }
}
