#include <bits/stdc++.h>
using namespace std;
long long t, n, m, a[200005], b[200005], d, kt, kq[30], j;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    memset(b, 0, sizeof(b));
    memset(kq, 0, sizeof(kq));
    memset(a, 0, sizeof(a));
    cin >> n >> m >> s;
    s = ' ' + s;
    for (long long i = 1; i <= m; i++) {
      cin >> d;
      a[d]++;
    }
    for (long long i = n - 1; i >= 1; i--) a[i] += a[i + 1];
    for (long long i = 1; i <= n; i++) {
      kq[s[i] - 'a' + 1] += (a[i] + 1);
    }
    for (long long i = 1; i <= 26; i++) cout << kq[i] << " ";
    cout << '\n';
  }
  return 0;
}
