#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 1e5 + 11;
long long ans[26 + 1];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<vector<long long> > cache(n + 1, vector<long long>(26));
    for (long long i = 0; i < n; i++) {
      cache[i + 1] = cache[i];
      cache[i + 1][s[i] - 'a']++;
    }
    memset(ans, 0, sizeof ans);
    for (long long i = 0; i < m; i++) {
      long long x;
      cin >> x;
      for (long long j = 0; j < 26; j++) ans[j] += cache[x][j];
    }
    for (long long i = 0; i < 26; i++) ans[i] += cache[n][i];
    for (long long i = 0; i < 26; i++) cout << ans[i] << " ";
    cout << endl;
  }
}
