#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int q, n, m, a[27], b[N];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> q;
  while (q--) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    cin >> n >> m;
    cin >> s;
    for (int i = 0; i < n; ++i) ++a[(s[i] - 'a')];
    for (int i = 1; i <= m; ++i) {
      int x;
      cin >> x;
      ++b[0], --b[x];
    }
    int cur = 0;
    for (int i = 0; i < n; ++i) {
      cur += b[i];
      a[(s[i] - 'a')] += cur;
    }
    for (int i = 0; i < 26; ++i) cout << a[i] << ' ';
    cout << '\n';
  }
}
