#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<int> v(n), res(26);
    for (int i = 0; i < m; i++) {
      int val;
      cin >> val;
      val -= 1;
      v[val]++;
    }
    for (int i = n - 1; i > 0; i--) v[i - 1] += v[i];
    for (int i = 0; i < n; i++) res[s[i] - 'a'] += (v[i] + 1);
    for (int i = 0; i < 26; i++) cout << res[i] << " ";
    cout << endl;
  }
}
