#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, m;
    string s;
    cin >> n >> m >> s;
    vector<long long> pref(n);
    for (long long i = 0, p; i < m; ++i) {
      cin >> p;
      ++pref[p - 1];
    }
    for (long long i = n - 1; i > 0; --i) {
      pref[i - 1] += pref[i];
    }
    vector<long long> ans(26);
    for (long long i = 0; i < n; ++i) {
      ans[s[i] - 'a'] += pref[i];
      ++ans[s[i] - 'a'];
    }
    for (long long i = 0; i < 26; ++i) {
      cout << ans[i] << " ";
    }
    cout << '\n';
  }
  return 0;
}
