#include <bits/stdc++.h>
using namespace std;
long long h[200001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, m, g[123] = {0}, c = 0, x, v[123] = {0};
    for (long long i = 0; i <= 200000; i++) h[i] = 0;
    cin >> n >> m;
    string s;
    cin >> s;
    for (long long i = 0; i < n; i++) v[(int)s[i]]++;
    long long p[m];
    for (long long i = 0; i < m; i++) {
      cin >> p[i];
      h[p[i] - 1]++;
    }
    sort(p, p + m);
    for (long long i = p[m - 1] - 1; i >= 0; i--) {
      if (h[i] > 0) {
        while (h[i]--) {
          c++;
        }
        v[(int)s[i]] += c;
      } else {
        v[(int)s[i]] += c;
      }
    }
    for (long long i = 97; i <= 122; i++) {
      cout << v[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
