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