#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, m, p, r;
  string str;
  vector<int> counts(26), reps;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> n >> m;
    fill(counts.begin(), counts.end(), 0);
    reps.resize(n - 1);
    fill(reps.begin(), reps.end(), 0);
    cin >> str;
    for (int j = 0; j < m; j++) {
      cin >> p;
      reps[p - 1]++;
    }
    r = 1;
    counts[str[n - 1] - 'a']++;
    for (int j = n - 2; j >= 0; j--) {
      r += reps[j];
      counts[str[j] - 'a'] += r;
    }
    for (auto &c : counts) cout << c << " ";
    cout << endl;
  }
  return 0;
}
