#include <bits/stdc++.h>
using std::cin;
using std::cout;
const int M = 2e5;
void testcase(int n, int m) {
  std::string s;
  cin >> s;
  int alpha[26] = {0}, a[M + 1];
  for (int i = 0; i < m; ++i) cin >> a[i];
  std::sort(a, a + m);
  int i = 0, fromindex = 0, toindex, subamount = 0;
  while (i < m) {
    int j = i;
    while (a[j] == a[i]) ++j;
    toindex = a[i];
    for (int i2 = fromindex; i2 < toindex; ++i2)
      alpha[s[i2] - 'a'] += (m - subamount);
    subamount += j - i;
    fromindex = toindex;
    i = j;
  }
  for (i = 0; i < n; ++i) alpha[s[i] - 'a']++;
  for (i = 0; i < 26; ++i) cout << alpha[i] << " ";
  cout << "\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    testcase(n, m);
  }
}
