#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    int arr[m];
    for (int i = 0; i < m; i++) {
      cin >> arr[i];
      arr[i] = arr[i] - 1;
    }
    int cnt[26];
    memset(cnt, 0, sizeof(cnt));
    int cod[n][26];
    memset(cod, 0, sizeof(cod));
    for (int i = 0; i < n; i++) {
      cod[i][s[i] - 97]++;
      if (i > 0) {
        for (int j = 0; j < 26; j++) {
          cod[i][j] = cod[i - 1][j];
        }
        cod[i][s[i] - 97]++;
      }
    }
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < 26; j++) cnt[j] += cod[arr[i]][j];
    }
    for (int i = 0; i < n; i++) cnt[s[i] - 97]++;
    for (int i = 0; i < 26; i++) cout << cnt[i] << " ";
    cout << endl;
  }
  return 0;
}
