#include <bits/stdc++.h>
using namespace std;
int main() {
  int mark[27];
  int test;
  cin >> test;
  while (test--) {
    int n, m, x;
    memset(mark, 0, sizeof(mark));
    cin >> n >> m;
    vector<int> v[27];
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
      x = s[i] - 'a';
      mark[x]++;
      v[x].push_back(i + 1);
    }
    for (int i = 0; i < m; i++) {
      cin >> x;
      for (int j = 0; j < 26; j++) {
        auto low = upper_bound(v[j].begin(), v[j].end(), x);
        long long int a = low - v[j].begin();
        mark[j] += a;
      }
    }
    for (int i = 0; i < 26; i++) cout << mark[i] << " ";
    cout << endl;
  }
  return 0;
}
