#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
long long n, m, a[200010], p[200010], val[200010], num[30];
signed main() {
  ios::sync_with_stdio(false);
  long long t;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    string s;
    cin >> s;
    for (long long i = 1; i <= n; i++) val[i] = 0;
    for (long long i = 1; i <= 26; i++) num[i] = 0;
    for (long long i = 1; i <= m; i++) {
      cin >> p[i];
      val[p[i]]++;
    }
    a[n] = 1;
    for (long long i = n - 1; i >= 1; i--) {
      a[i] = a[i + 1] + val[i];
    }
    for (long long i = 1; i <= n; i++) {
      num[s[i - 1] - 'a' + 1] += a[i];
    }
    for (long long i = 1; i <= 26; i++) {
      cout << num[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
