#include <bits/stdc++.h>
using namespace std;
long long int n, m;
void solve() {
  cin >> n >> m;
  string s;
  cin >> s;
  long long int a[26] = {0};
  long long int z;
  vector<long long int> v(n, 0);
  for (long long int i = 0; i < m; i++) {
    cin >> z;
    z--;
    if (z == n - 1) {
      v[n - 1]--;
    } else {
      v[0]++;
      v[z + 1]--;
    }
  }
  a[s[0] - 'a'] += v[0] + 1;
  for (long long int i = 1; i < n; i++) {
    v[i] = v[i] + v[i - 1];
    a[s[i] - 'a'] += v[i] + 1;
  }
  for (long long int i = 0; i < 26; i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int x;
  cin >> x;
  for (long long int i = 1; i <= x; i++) solve();
  return 0;
}
