#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 20;
long long pfx[N];
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    long long mx = 0;
    for (long long i = 0; i <= n; i++) pfx[i] = 0;
    long long x;
    for (long long i = 0; i < m; i++) cin >> x, pfx[x]++, mx = max(mx, x);
    long long fq[26];
    memset(fq, 0, sizeof fq);
    for (long long i = mx; i >= 1; i--) pfx[i] += pfx[i + 1];
    for (long long i = 1; i <= n; i++) fq[s[i - 1] - 'a'] += pfx[i] + 1;
    for (long long i = 0; i < 26; i++) cout << fq[i] << " ";
    cout << endl;
  }
  return 0;
}
