#include <bits/stdc++.h>
using namespace std;
long long i, j, k, t, n, q, l, r, mid;
long long arr[30];
long long x, m;
string s;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    memset(arr, 0, sizeof(arr));
    cin >> n >> m;
    long long mp[n + 3];
    memset(mp, 0, sizeof(mp));
    cin >> s;
    s = '@' + s;
    for (long long i = 1; i < m + 1; i++) {
      cin >> x;
      mp[1]++;
      mp[x + 1]--;
    }
    for (long long i = 1; i < n + 1; i++) {
      mp[i] += mp[i - 1];
      arr[s[i] - 'a'] += mp[i] + 1;
    }
    for (long long i = 0; i < 26; i++) {
      cout << arr[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
