#include <bits/stdc++.h>
using namespace std;
char s[200002];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    scanf("%d%d", &n, &m);
    vector<int> f(n);
    scanf("%s", s);
    for (int i = 0; i < m; ++i) {
      int x;
      scanf("%d", &x);
      --x;
      ++f[x];
    }
    for (int i = n - 2; i >= 0; --i) f[i] += f[i + 1];
    long long freq[26] = {};
    for (int i = 0; i < n; ++i) freq[s[i] - 'a'] += f[i] + 1;
    for (int i = 0; i < 26; ++i) printf("%lld ", freq[i]);
    puts("");
  }
  return 0;
}
