#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    long long int arr[m];
    for (long long int i = 0; i < m; i++) {
      cin >> arr[i];
    }
    vector<long long int> v(n);
    for (long long int i = 0; i < m; i++) {
      v[arr[i] - 1]++;
    }
    for (long long int i = n - 1; i > 0; i--) {
      v[i - 1] += v[i];
    }
    long long int hash[123];
    memset(hash, 0, sizeof(hash));
    for (long long int i = 0; i < n; i++) {
      hash[s[i]] += (v[i] + 1);
    }
    for (long long int i = 97; i < 123; i++) {
      cout << hash[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
