#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    int freq[n][26];
    memset(freq, 0, sizeof freq);
    freq[0][s[0] - 'a']++;
    for (int i = 1; i < n; i++) {
      for (int j = 0; j < 26; j++) {
        freq[i][j] += freq[i - 1][j];
      }
      freq[i][s[i] - 'a']++;
    }
    int ans[26] = {0};
    while (m--) {
      int index;
      cin >> index;
      index--;
      for (int i = 0; i < 26; i++) {
        ans[i] += freq[index][i];
      }
    }
    for (char x : s) {
      ans[x - 'a']++;
    }
    for (int i = 0; i < 26; i++) cout << ans[i] << " ";
    cout << endl;
  }
}
