#include <bits/stdc++.h>
const int N = 2e5 + 9;
int t, n, m, p[N], x;
char c[N];
int s[30];
using namespace std;
int main() {
  scanf("%d", &t);
  while (t--) {
    memset(s, 0, sizeof s);
    memset(p, 0, sizeof p);
    scanf("%d %d\n", &n, &m);
    for (int i = 0; i < n; i++) scanf("%c", &c[i]);
    for (int i = 0; i < m; i++) {
      scanf("%d", &x);
      ++p[x - 1];
    }
    for (int i = n - 2; i >= 0; --i) p[i] += p[i + 1];
    for (int i = 0; i < n; i++) ++s[c[i] - 'a'];
    for (int i = 0; i < n; i++) s[c[i] - 'a'] += p[i];
    for (int i = 0; i < 26; i++) printf("%d ", s[i]);
    puts("");
  }
}
