#include <bits/stdc++.h>
using namespace std;
multiset<pair<int, int> > pool;
multiset<pair<int, int> >::iterator it;
struct node {
  int first, second;
  bool operator<(const node& b) const {
    if (first == b.first) return second < b.second;
    return first > b.first;
  }
};
int letter[300000 + 5], flag[300000 + 5], point[300000 + 5], s[300000 + 5];
int re(char c) { return c - 'a' + 1; }
void solve() {
  memset(letter, 0, sizeof(letter));
  memset(flag, 0, sizeof(flag));
  memset(point, 0, sizeof(point));
  memset(s, 0, sizeof(s));
  int n, m;
  scanf("%d%d", &n, &m);
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &s[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &point[i]);
  }
  point[m + 1] = n;
  sort(point, point + 1 + m + 1);
  for (int i = 0; i <= m; i++) {
    for (int j = point[i]; j < point[i + 1]; j++) {
      flag[re(s[j])]++;
    }
    for (int i = 1; i <= 26; i++) {
      letter[i] += flag[i];
    }
  }
  for (int i = 1; i <= 26; i++) {
    printf("%d ", letter[i]);
  }
  printf("\n");
}
signed main() {
  int t = 1;
  scanf("%d", &t);
  while (t--) {
    solve();
  }
}
