#include <bits/stdc++.h>
using namespace std;
const long long INF = 2000000000000000000LL;
const int inf = 0x3f3f3f3f;
const long double EPS = 1e-9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    map<char, int> M;
    for (int i = 0; i < 26; i++) M['a' + i] = i;
    int n, m;
    string s;
    cin >> n >> m >> s;
    vector<int> v;
    long long ans[30] = {0};
    for (int i = 0; i < m; i++) {
      int x;
      cin >> x;
      v.push_back(x);
    }
    v.push_back(2e5);
    sort((v).begin(), (v).end());
    int cnt = 1, pos = 0, j = 0, p = 0;
    for (int i = 0; i < m; i++) {
      if (v[i] != v[i + 1]) {
        for (j = pos; j < v[i]; j++) {
          ans[M[s[j]]] += m - p + 1;
        }
        pos = v[i];
        p = i + 1;
      }
    }
    for (j = pos; j < n; j++) {
      ans[M[s[j]]] += 1;
    }
    for (int i = 0; i < 26; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
