#include <bits/stdc++.h>
using namespace std;
int t, n, m, tmp;
int main() {
  scanf("%d", &t);
  while (t--) {
    int p[200002] = {
        0,
    };
    char s[200002] = {
        0,
    };
    int ans[26] = {
        0,
    };
    int cnt = 1;
    scanf("%d %d\n", &n, &m);
    scanf("%s", s);
    for (int i = 0; i < n; ++i) ans[s[i] - 'a']++;
    for (int i = 0; i < m; ++i) {
      scanf("%d", &tmp);
      p[i] = tmp - 1;
    }
    sort(p, p + m);
    for (int i = m - 1; i > 0; i--) {
      for (int j = p[i]; j > p[i - 1]; j--) {
        ans[s[j] - 'a'] += cnt;
      }
      ++cnt;
    }
    for (int i = 0; i <= p[0]; ++i) {
      ans[s[i] - 'a'] += cnt;
    }
    for (int i = 0; i < 26; ++i) printf("%d ", ans[i]);
    puts("");
  }
}
