#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n, p;
    cin >> n >> p;
    string s;
    cin >> s;
    long long int parr[p + 1];
    for (int i = 0; i < p; i++) cin >> parr[i];
    long long int arr[n + 1];
    memset(arr, 0, sizeof(arr));
    for (int i = 0; i < p; i++) {
      arr[parr[i] - 1] += 1;
    }
    long long int tmp = 0;
    arr[n] = 1;
    for (int i = n; i >= 0; i--) {
      if (arr[i] != 0) {
        tmp += arr[i];
        arr[i] = tmp;
      } else {
        arr[i] += tmp;
      }
    }
    int freq[27];
    memset(freq, 0, sizeof(freq));
    for (int i = 0; i < n; i++) {
      freq[s[i] - 'a'] += arr[i];
    }
    for (int i = 0; i < 26; i++) {
      cout << freq[i] << " ";
    }
    cout << "\n";
  }
}
