#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<int> p(m);
    for (long long i = 0; i < (long long)m; i++) {
      int x;
      cin >> x;
      p[i] = x - 1;
    }
    sort(p.begin(), p.end());
    vector<int> res(26);
    for (long long i = 0; i < (long long)n; i++) res[s[i] - 'a']++;
    for (long long i = 0; i < (long long)n; i++) {
      auto ind = lower_bound(p.begin(), p.end(), i);
      int idx = ind - p.begin();
      res[s[i] - 'a'] += m - idx;
    }
    for (int i : res) cout << i << " ";
    cout << endl;
  }
  return 0;
}
