#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize "trapv"
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
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;
    cin >> n >> m;
    string s;
    cin >> s;
    map<char, long long> v;
    map<long long, long long> f, r;
    long long p[m];
    for (long long i = 0; i < m; i++) {
      cin >> p[i];
      f[p[i] - 1]++;
    }
    if (f.find(n) == f.end()) {
      r[n - 1] = 1;
    } else {
      r[n - 1] = f[n - 1] + 1;
    }
    for (long long i = n - 2; i >= 0; i--) {
      if (f.find(i) == f.end())
        r[i] = r[i + 1];
      else
        r[i] = r[i + 1] + f[i];
    }
    for (long long i = 0; i < n; i++) {
      v[s[i]] += r[i];
    }
    for (char i = 'a'; i <= 'z'; i++) {
      cout << v[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
