#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, pnt;
string s;
vector<int> p;
void solve() {
  cin >> n >> m;
  cin >> s;
  p.resize(m);
  int ans[26] = {0};
  for (int i = 0; i < m; i++) {
    cin >> p[i];
  }
  cnt = m + 1;
  pnt = 0;
  sort(p.begin(), p.end());
  for (int i = 0; i < s.length(); i++) {
    ans[s[i] - 'a'] += cnt;
    while (pnt != m && p[pnt] == 1 + i) {
      cnt--;
      pnt++;
    }
  }
  for (int i = 0; i < 26; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
