#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
const int N = 1e6;
const int base = 31;
int n, p[N], t, res[N], m, a[N];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n >> m;
    cin >> s;
    s = ' ' + s;
    for (int i = 0; i < max(26, m); i++) {
      res[i] = 0;
      p[i] = 0;
    }
    for (int i = 0; i < m; i++) {
      cin >> a[i];
    }
    sort(a, a + m);
    for (int i = 1; i <= n; i++) {
      res[int(s[i]) - 'a']++;
    }
    int cnt = 0, j = 0;
    for (int i = 1; i <= n; i++) {
      res[int(s[i]) - 'a'] += (m - cnt);
      while (i == a[cnt]) {
        if (cnt == m) break;
        cnt++;
      }
    }
    for (int i = 0; i < 26; i++) {
      cout << res[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
