#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    int ans[26];
    memset(ans, 0, sizeof ans);
    string s;
    cin >> s;
    for (auto x : s) ans[x - 'a']++;
    int pre[n];
    int x;
    memset(pre, 0, sizeof pre);
    for (int i = 0; i < m; i++) {
      cin >> x;
      pre[x - 1]++;
    }
    for (int i = n - 1; i; i--) pre[i - 1] += pre[i];
    for (int i = 0; i < n; i++) ans[s[i] - 'a'] += pre[i];
    for (auto i : ans) cout << i << " ";
    cout << "\n";
  }
}
