#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  int n, m;
  string s;
  while (t--) {
    int ans[26] = {0};
    cin >> n >> m;
    cin >> s;
    int p[m];
    for (int i = 0; i < m; i++) cin >> p[i];
    sort(p, p + m);
    for (int i = 0; i < n; i++) {
      ans[s[i] - 'a'] += m - (lower_bound(p, p + m, i + 1) - p) + 1;
    }
    for (int i = 0; i < 26; i++) cout << ans[i] << " ";
    cout << endl;
  }
  return 0;
}
