#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  string s;
  vector<long long> a(m);
  cin >> s;
  for (long long &i : a) cin >> i;
  sort(a.begin(), a.end());
  vector<long long> mask(26, 0);
  long long last = 0;
  for (long long i = 0; i < n; i++) {
    for (; last < m; last++) {
      if (a[last] - 1 >= i) break;
    }
    mask[s[i] - 'a'] += (m - last + 1);
  }
  for (long long i : mask) cout << i << ' ';
  cout << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  long long n = 1;
  cin >> n;
  while (n--) solve();
  return 0;
}
