#include <bits/stdc++.h>
using namespace std;
int t, n, m, a[200005], v[26];
string s;
int ser(int x) {
  int l = 1, r = m, mid, best = m + 1;
  while (l <= r) {
    mid = (l + r) / 2;
    if (a[mid] >= x) {
      best = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return best;
}
int main() {
  int i, j, p;
  cin >> t;
  while (t--) {
    memset(v, 0, sizeof(v));
    cin >> n >> m >> s;
    for (i = 1; i <= m; i++) cin >> a[i];
    sort(a + 1, a + m + 1);
    for (i = 1; i <= n; i++) {
      int pos = ser(i);
      v[s[i - 1] - 'a'] += m - pos + 1;
    }
    for (i = 0; i < n; i++) v[s[i] - 'a']++;
    for (i = 0; i < 26; i++) cout << v[i] << ' ';
    cout << endl;
  }
  return 0;
}
