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