#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a[26];
    memset(a, 0, sizeof a);
    int n, m;
    cin >> n >> m;
    int p[m + 1];
    string s;
    cin >> s;
    for (int i = 0; i < m; i++) {
      cin >> p[i];
      p[i]--;
    }
    sort(p, p + m);
    p[m] = n;
    for (int i = 0, j = 0; i < n; i++) {
      int x = s[i] - 97;
      if (i <= p[j]) {
        a[x] += m + 1 - j;
      } else {
        while (i > p[j]) j++;
        a[x] += m + 1 - j;
      }
    }
    for (int i = 0; i < 26; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
