#include <bits/stdc++.h>
using namespace std;
bool isSorted(long long int n, long long int a[]) {
  long long int i;
  for (i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1]) return false;
  }
  return true;
}
int32_t main() {
  time_t start = clock();
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, diff, n, m, i;
  bool flg;
  string str;
  cin >> t;
  while (t--) {
    long long int ans[26];
    for (i = 0; i < 26; i++) ans[i] = 0;
    cin >> n >> m;
    cin >> str;
    long long int pos[m];
    for (i = 0; i < m; i++) cin >> pos[i];
    for (i = 0; i < n; i++) {
      ans[str[i] - 97] += 1;
    }
    sort(pos, pos + m);
    long long int j;
    for (i = 0, j = 0; i < n; i++) {
      while (j < m && pos[j] <= i) ++j;
      ans[str[i] - 97] += (m - j);
    }
    for (i = 0; i < 26; i++) cout << ans[i] << " ";
    cout << '\n';
  }
  cerr << fixed << setprecision(6)
       << "Time: " << 1.0 * (clock() - start) / CLOCKS_PER_SEC << '\n';
  return 0;
}
