#include <bits/stdc++.h>
using namespace std;
char s[200005];
long long c[30][200005];
long long ans[30];
int main() {
  int t;
  cin >> t;
  while (t--) {
    for (int i = 0; i < 30; i++) ans[i] = 0;
    int n, m;
    scanf("%d%d", &n, &m);
    scanf("%s", s + 1);
    for (register int i = 1; i <= n; ++i) {
      char C = s[i];
      for (register int j = 0; j < 26; ++j) {
        if (char('a' + j) == C)
          c[j][i] = c[j][i - 1] + 1;
        else
          c[j][i] = c[j][i - 1];
      }
    }
    for (register int i = 1; i <= m; ++i) {
      int x;
      scanf("%d", &x);
      for (register int k = 0; k < 26; ++k) ans[k] += c[k][x];
    }
    for (register int k = 0; k < 26; ++k) ans[k] += c[k][n];
    for (register int i = 0; i < 25; ++i) printf("%lld ", ans[i]);
    printf("%lld\n", ans[25]);
  }
}
