#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<int> p(m);
    for (int i = 0; i < m; ++i) cin >> p[i];
    vector<int> count(n);
    for (int i = 0; i < m; ++i) {
      count[p[i] - 1]++;
    }
    count[n - 1]++;
    for (int i = count.size() - 2; i >= 0; --i) count[i] += count[i + 1];
    map<char, int> mp;
    for (int i = 0; i < count.size(); ++i) {
      mp[s[i]] += count[i];
    }
    for (char c = 'a'; c <= 'z'; ++c) {
      if (mp.count(c))
        cout << mp[c] << " ";
      else
        cout << 0 << " ";
    }
    cout << endl;
  }
  return 0;
}
