#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int letter[26] = {0};
    string str;
    int m, n;
    cin >> n >> m;
    cin >> str;
    vector<int> p(m + 1);
    for (int i = 0; i < m; i++) {
      cin >> p[i];
    }
    vector<int> cnt(n);
    for (int i = 0; i < m; i++) {
      cnt[p[i] - 1]++;
    }
    cnt[n - 1]++;
    for (int i = n - 1; i > 0; i--) {
      cnt[i - 1] += cnt[i];
    }
    for (int i = 0; i < n; i++) {
      letter[str[i] - 'a'] += cnt[i];
    }
    for (int i = 0; i < 26; i++) {
      cout << letter[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
