#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    string s;
    cin >> n >> m >> s;
    vector<int> p(m);
    vector<int> sum(n + 1);
    for (int i = 0; i < m; i++) {
      cin >> p[i];
      sum[0]++;
      sum[p[i]]--;
    }
    sum[0]++;
    for (int i = 0; i < n; i++) {
      sum[i + 1] += sum[i];
    }
    vector<long long> alpha(26);
    for (int i = 0; i < n; i++) {
      alpha[s[i] - 'a'] += sum[i];
    }
    for (int i = 0; i < 26; i++) {
      cout << alpha[i] << ((i + 1 == 26) ? "\n" : " ");
    }
  }
}
