#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int N = 200010, mod = 1e9 + 7, INF = 0x3f3f3f3f;
const double eps = 1e-6;
int n, m;
long long p[N], sum[100];
char s[N];
int main() {
  int _;
  scanf("%d", &_);
  while (_--) {
    scanf("%d%d%s", &n, &m, s + 1);
    for (int i = 1; i <= m; i++) {
      int x;
      scanf("%d", &x);
      p[1]++;
      p[x + 1]--;
    }
    p[1]++;
    for (int i = 1; i <= n; i++) p[i] += p[i - 1];
    for (int i = 1; i <= n; i++) sum[s[i] - 'a'] += p[i];
    for (int i = 0; i < 26; i++) printf("%lld ", sum[i]);
    puts("");
    for (int i = 1; i <= n; i++) p[i] = 0;
    for (int i = 0; i < 26; i++) sum[i] = 0;
  }
  return 0;
}
