#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int32_t main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<long long int> v(n, 0);
    for (long long int i = 0; i < m; i++) {
      long long int x;
      cin >> x;
      x--;
      v[x] += 1;
    }
    v[n - 1] += 1;
    for (long long int i = n - 2; i >= 0; i--) v[i] = v[i] + v[i + 1];
    vector<long long int> ans(26, 0);
    for (long long int i = 0; i < n; i++) {
      ans[s[i] - 97] += v[i];
    }
    for (long long int i = 0; i < 26; i++) cout << ans[i] << " ";
    cout << endl;
  }
}
