#include <bits/stdc++.h>
using namespace std;
template <class T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
template <class T>
void printVector(const std::vector<T> arr) {
  for (auto i : arr) cout << i << " ";
  cout << '\n';
}
template <class T>
void printArray(T arr[], long long int n) {
  for (long long int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << '\n';
}
int main() {
  fastio();
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    string str;
    cin >> str;
    std::vector<long long int> arr(m);
    for (long long int i = 0; i < m; i++) cin >> arr[i];
    long long int count[n][26];
    memset(count, 0, sizeof(count));
    for (long long int i = 0; i < n; i++) {
      if (i == 0) {
        count[i][str[i] - 'a']++;
      } else {
        for (long long int j = 0; j < 26; j++) count[i][j] = count[i - 1][j];
        count[i][str[i] - 'a']++;
      }
    }
    long long int ans[26];
    memset(ans, 0, sizeof(ans));
    for (long long int i = 0; i < m; i++) {
      long long int a = arr[i];
      for (long long int j = 0; j < 26; j++) {
        long long int co = count[a - 1][j];
        ans[j] += co;
      }
    }
    for (long long int j = 0; j < 26; j++) ans[j] += count[n - 1][j];
    printArray(ans, 26);
  }
}
