#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t, n, m, a[200001], i, j, t1, ans[26];
  string str;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> n >> m;
    memset(a, 0, sizeof(int) * n);
    memset(ans, 0, sizeof(int) * 26);
    cin >> str;
    for (j = 0; j < m; j++) {
      cin >> t1;
      a[t1 - 1]++;
    }
    for (j = n - 1; j > 0; j--) a[j - 1] += a[j];
    for (j = 0; j < n; j++) ans[str[j] - 'a'] += a[j] + 1;
    for (j = 0; j < 26; j++) cout << ans[j] << " ";
    cout << '\n';
  }
  return 0;
}
