#include <bits/stdc++.h>
long long N = 1e18 + 2;
using namespace std;
char ar[200005];
int main() {
  int tc;
  scanf("%d", &tc);
  while (tc--) {
    int n, m;
    scanf("%d %d %s", &n, &m, &ar);
    vector<int> freq(n + 2, 0), ans(26, 0);
    for (int i = 0; i < m; i++) {
      int p;
      scanf("%d", &p);
      freq[1]++;
      freq[p + 1]--;
    }
    freq[1]++;
    for (int i = 1; i <= n; i++) {
      freq[i] += freq[i - 1];
      ans[ar[i - 1] - 'a'] += freq[i];
    }
    for (int i = 0; i < 26; i++) printf("%d%c", ans[i], " \n"[i + 1 == 26]);
  }
  return 0;
}
