#include <bits/stdc++.h>
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 5;
using namespace std;
int t, n, m, x;
int a[N][26] = {0}, vis[26] = {0};
char c[N] = {0};
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d%d", &n, &m);
    scanf("%s", c);
    for (int i = 0; i < 26; i++) a[0][i] = 0;
    for (int i = 0; i < n; i++) {
      if (i > 0) {
        for (int j = 0; j < 26; j++) {
          a[i][j] = a[i - 1][j];
        }
      }
      a[i][c[i] - 'a']++;
    }
    for (int i = 0; i < 26; i++) vis[i] = a[n - 1][i];
    while (m--) {
      cin >> x;
      for (int i = 0; i < 26; i++) {
        vis[i] += a[x - 1][i];
      }
    }
    printf("%d", vis[0]);
    for (int i = 1; i < 26; i++) {
      printf(" %d", vis[i]);
    }
    printf("\n");
  }
  return 0;
}
