#include <bits/stdc++.h>
using namespace std;
char s[200000 + 1];
int c[200000 + 1];
int a[26];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    cin >> s;
    memset(c, 0, sizeof(c));
    memset(a, 0, sizeof(a));
    c[0] = m + 1;
    for (int i = 0; i < m; ++i) {
      int p;
      cin >> p;
      c[p] -= 1;
    }
    int count = 0;
    for (int i = 0; i < n; ++i) {
      count += c[i];
      a[s[i] - 'a'] += count;
    }
    for (int i = 0; i < 26; ++i) {
      cout << a[i] << (i == 25 ? '\n' : ' ');
    }
  }
  return 0;
}
