#include <bits/stdc++.h>
long long int MOD = 1000000007;
using namespace std;
long long int power(long long int xui, long long int y, long long int p) {
  long long int res = 1;
  xui = xui % p;
  while (y > 0) {
    if (y & 1) res = (res * xui) % p;
    y = y >> 1;
    xui = (xui * xui) % p;
  }
  return res % MOD;
}
long long int modInv(long long int n) { return power(n, MOD - 2, MOD); }
void add(long long int arr[], long long int N, long long int lo,
         long long int hi, long long int val) {
  arr[lo] += val;
  if (hi != N - 1) arr[hi + 1] -= val;
}
void updateArray(long long int arr[], long long int N) {
  for (long long int i = 1; i < N; i++) arr[i] += arr[i - 1];
}
void printArr(long long int arr[], long long int N) { updateArray(arr, N); }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    long long int p[m];
    for (long long int i = 0; i < m; ++i) cin >> p[i];
    long long int ans[n];
    for (long long int i = 0; i < n; ++i) ans[i] = 0;
    for (long long int i = 0; i < m; ++i) {
      add(ans, n, 0, p[i] - 1, 1);
    }
    add(ans, n, 0, n - 1, 1);
    printArr(ans, n);
    unordered_map<char, long long int> mp2;
    for (long long int i = 0; i < n; ++i) {
      mp2[s[i]] += ans[i];
    }
    for (long long int i = 0; i < 26; ++i) {
      char c = (char)(97 + i);
      if (mp2.find(c) == mp2.end()) {
        cout << 0 << " ";
      } else {
        cout << mp2[c] << " ";
      }
    }
    cout << '\n';
  }
}
