#include <bits/stdc++.h>
int dx4[] = {0, 0, -1, 1};
int dy4[] = {-1, 1, 0, 0};
bool valid(int r, int c, int x, int y) {
  if (x >= 1 && x <= r && y >= 1 && y <= c) return 1;
  return 0;
}
using namespace std;
int main() {
  int t;
  scanf("%d", &(t));
  for (int cs = 1; cs <= t; cs++) {
    long long int n, m;
    scanf("%lld %lld", &(n), &(m));
    long long int ans[n + 2];
    long long int mp[30];
    memset(ans, 0, sizeof(ans));
    memset(mp, 0, sizeof(mp));
    string s;
    cin >> s;
    long long int a[m + 2];
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= m; i++) {
      scanf("%lld", &(a[i]));
      ans[1]++;
      ans[a[i] + 1]--;
    }
    ans[1]++;
    ans[n + 1]--;
    for (int i = 1; i <= n; i++) {
      ans[i] += ans[i - 1];
    }
    for (int i = 0; i < n; i++) {
      int x = (int)s[i] - 97;
      mp[x] += ans[i + 1];
    }
    for (int ch = 0; ch < 26; ch++) printf("%lld ", mp[ch]);
    printf("\n");
  }
  return 0;
}
