#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string x;
    cin >> x;
    int ar[m];
    for (int i = 0; i < m; i++) {
      cin >> ar[i];
    }
    int prefix[n + 1];
    for (int i = 0; i <= n; i++) {
      prefix[i] = 0;
    }
    for (int i = 0; i < m; i++) {
      prefix[ar[i]]++;
    }
    for (int i = n; i >= 0; i--) {
      if (i < n) {
        prefix[i] += prefix[i + 1];
      }
    }
    int freq[26];
    for (int i = 0; i < 26; i++) freq[i] = 0;
    for (int i = 0; i < n; i++) {
      freq[x[i] - 'a'] += prefix[i + 1] + 1;
    }
    for (int i = 0; i < 26; i++) {
      cout << freq[i] << " ";
    }
    cout << endl;
  }
}
