#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<int> pref(n);
    fill(pref.begin(), pref.end(), 0);
    for (int a, i = 0; i < m; i++) {
      cin >> a;
      pref[a - 1]++;
    }
    for (int i = n - 1; i > 0; i--) pref[i - 1] += pref[i];
    int freq[27] = {0};
    for (int i = 0; i < n; i++) {
      freq[s[i] - 'a']++;
      freq[s[i] - 'a'] += pref[i];
    }
    for (int i = 0; i < 26; i++) cout << freq[i] << " ";
    cout << "\n";
  }
}
