#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string a;
    cin >> a;
    int arr[n + 5];
    set<int> st;
    int mark[n + 5];
    memset(mark, 0, sizeof mark);
    for (int i = 0; i < m; i++) {
      int x;
      cin >> x;
      mark[0]++;
      mark[x]--;
    }
    mark[0]++;
    for (int i = 1; i <= n; i++) {
      mark[i] += mark[i - 1];
    }
    int ans[28];
    memset(ans, 0, sizeof ans);
    for (int i = 0; i < n; i++) {
      int x = a[i] - 'a';
      ans[x] += mark[i];
    }
    for (int i = 0; i < 26; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
