#include <bits/stdc++.h>
using namespace std;
void solution(int n, int m, string s, vector<int> arr) {
  int count[n];
  for (int i = 0; i < n; i++) count[i] = 0;
  for (int i = m - 1; i >= 0; i--) {
    count[arr[i] - 1]++;
  }
  int ans[26];
  for (int i = 0; i < 26; i++) ans[i] = 0;
  if (n >= 2)
    for (int i = n - 2; i >= 0; i--) {
      count[i] += count[i + 1];
    }
  for (int i = 0; i < n; i++) {
    ans[s[i] - 'a'] += count[i] + 1;
  }
  for (int i = 0; i < 26; i++) cout << ans[i] << " ";
  cout << "\n";
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<int> arr(m);
    for (int j = 0; j < m; j++) cin >> arr[j];
    solution(n, m, s, arr);
  }
  return 0;
}
