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