#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[200005];
int main() {
  long long t, n, m, c[30], i, d, e;
  cin >> t;
  string s;
  while (t--) {
    cin >> n >> m;
    cin >> s;
    for (i = 0; i < m; i++) cin >> a[i];
    sort(a, a + m);
    d = a[m - 1];
    for (i = 1; i <= n; i++) b[i] = 1;
    long long j = 1, k;
    for (i = m - 2; i >= 0; i--) {
      if (a[i] != a[i + 1]) {
        e = a[i];
        for (k = d; k > e; k--) {
          b[k] = b[k] + j;
        }
        d = e;
      }
      j++;
    }
    for (i = 1; i <= d; i++) {
      b[i] += j;
    }
    memset(c, 0, sizeof(c));
    for (i = 0; i < n; i++) {
      char cc = s[i] - 'a';
      int dd = cc + 1;
      c[dd] += b[i + 1];
    }
    for (i = 1; i <= 26; i++) cout << c[i] << " ";
    cout << endl;
  }
  return 0;
}
