#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long int i, j, k, m, n, count = 0;
    cin >> n >> m;
    long int ans[26] = {0}, sol = 0;
    vector<long int> p(m);
    string s;
    cin >> s;
    for (i = 0; i < s.size(); i++) ans[s[i] - 'a']++;
    for (i = 0; i < m; i++) {
      cin >> p[i];
    }
    sort(p.begin(), p.end());
    for (j = 0; j < n; j++) {
      count = upper_bound(p.begin(), p.end(), j) - p.begin();
      count = m - count;
      ans[s[j] - 'a'] += count;
    }
    for (auto i : ans) cout << i << " ";
    cout << '\n';
  }
  return 0;
}
