#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j = 0, u, n, m;
  cin >> t;
  while (t--) {
    string s;
    cin >> n >> m >> s;
    vector<int> pref(n);
    for (i = 0; i < m; i++) {
      int p;
      cin >> p;
      pref[p - 1]++;
    }
    for (i = n - 1; i > 0; i--) {
      pref[i - 1] += pref[i];
    }
    vector<int> ans(26);
    for (i = 0; i < n; i++) {
      ans[s[i] - 'a'] += pref[i] + 1;
    }
    for (i = 0; i < 26; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
