#include <bits/stdc++.h>
using namespace std;
void add(vector<int>& a, vector<int>& b) {
  for (int i = 0; i < b.size(); i++) {
    a[i] += b[i];
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    map<int, int> res;
    for (int i = 0; i < m; i++) {
      int v;
      cin >> v;
      res[v - 1]++;
    }
    vector<int> dc(26, 0);
    vector<int> ans(26, 0);
    for (int i = 0; i < n; i++) {
      dc[s[i] - 'a']++;
      while (res[i] >= 1) {
        res[i]--;
        add(ans, dc);
      }
    }
    add(ans, dc);
    for (int i = 0; i < 26; i++) cout << ans[i] << " ";
    cout << endl;
  }
}
