#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    long long letter[26];
    long long freq[n + 1];
    string s;
    cin >> s;
    s = " " + s;
    for (long long i = (0); i < (n + 1); i++) freq[i] = 0;
    for (long long i = (0); i < (m); i++) {
      long long tmp;
      cin >> tmp;
      freq[1]++;
      freq[tmp + 1]--;
    }
    for (long long i = (1); i < (n + 1); i++) freq[i] += freq[i - 1];
    for (long long i = (0); i < (26); i++) letter[i] = 0;
    for (long long i = (1); i < (n + 1); i++) letter[s[i] - 'a'] += freq[i] + 1;
    for (long long i = (0); i < (26); i++) cout << letter[i] << " ";
    cout << endl;
  }
  return 0;
}
