#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j, n, m, ind;
  cin >> t;
  while (t--) {
    int arr[26];
    for (i = 0; i < 26; i++) {
      arr[i] = 0;
    }
    string str;
    vector<int> v;
    cin >> n >> m;
    cin >> str;
    for (i = 0; i < m; i++) {
      cin >> j;
      v.push_back(j);
    }
    std::sort(v.begin(), v.end(), std::greater<int>());
    for (i = 0; i < n; i++) {
      j = i + 1;
      auto up = std::upper_bound(v.begin(), v.end(), j, std::greater<int>());
      ind = up - v.begin();
      arr[str[i] - 'a'] = arr[str[i] - 'a'] + ind;
    }
    for (i = 0; i < n; i++) {
      arr[str[i] - 'a'] = arr[str[i] - 'a'] + 1;
    }
    for (i = 0; i < 26; i++) {
      cout << arr[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
