#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, letters[30], tries[200005];
  char s[200005];
  scanf(" %d", &t);
  for (int j = 0; j < t; j++) {
    int n, m, x;
    scanf("%d %d", &n, &m);
    scanf(" %s", s);
    for (int i = 0; i < 30; i++) letters[i] = 0;
    for (int i = 0; i < m; i++) {
      scanf(" %d", &tries[i]);
      tries[i]--;
    }
    tries[m] = -5;
    sort(tries, m + tries);
    int it = 0, result = 0;
    m++;
    for (int i = 0; i < n; i++) {
      letters[s[i] - 'a'] += m;
      while (m > 0 && i == tries[it]) {
        it++;
        m--;
      }
    }
    for (int i = 0; i < 26; i++) {
      printf("%d ", letters[i]);
    }
    printf("\n");
  }
  return 0;
}
