#include <bits/stdc++.h>
using namespace std;
int ans[27];
int a[200005];
int b[6];
bool cmp(int x, int y) { return x < y; }
int main() {
  int t;
  cin >> t;
  int n, m;
  while (t--) {
    memset(ans, 0, sizeof(ans));
    cin >> n >> m;
    string s;
    cin >> s;
    for (int i = 0; i < m; i++) {
      cin >> a[i];
    }
    sort(a, a + m, cmp);
    for (int i = 0; i < n; i++) {
      int pos = lower_bound(a, a + m, i + 1) - a;
      ans[s[i] - 'a'] += m + 1 - pos;
    }
    for (int i = 0; i < 26; i++) cout << ans[i] << " ";
    cout << endl;
    for (int i = 1; i < 5; i++) b[i] = 1;
  }
}
