#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long N = 200 * 1000 + 9;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
long long i, j, k;
void solve() {
  long long n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<long long> v(m);
  map<long long, long long> mpp;
  for (i = 0; i < m; i++) cin >> v[i], mpp[v[i]]++;
  vector<long long> prefix_sum(n + 1, 0);
  for (i = 1; i <= n; i++) {
    if (mpp[i]) prefix_sum[i] = mpp[i];
  }
  for (i = n - 1; i >= 1; i--) {
    prefix_sum[i] = prefix_sum[i + 1] + prefix_sum[i];
  }
  vector<long long> ans(27, 0);
  for (i = 0; i < n; i++) {
    ans[s[i] - 'a']++;
  }
  map<char, long long> mpr;
  for (i = 0; i < 26; i++) {
    for (j = 1; j <= n; j++) {
      long long x = s[j - 1] - 'a';
      if (x == i) ans[i] = ans[i] + prefix_sum[j];
    }
  }
  for (i = 0; i < 26; i++) cout << ans[i] << " ";
  cout << '\n';
  ;
  return;
}
signed main() {
  long long ___T;
  scanf("%lld", &___T);
  for (long long cs = 1; cs <= ___T; cs++) solve();
  return 0;
}
