#include <bits/stdc++.h>
using namespace std;
void fakemain() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    int a[n + 1];
    memset(a, 0, sizeof(a));
    for (int i = 0; i < m; i++) {
      int x;
      cin >> x;
      a[x]++;
    }
    a[n]++;
    int f[30];
    memset(f, 0, sizeof(f));
    f[s[n - 1] - 'a']++;
    for (int i = n - 1; i > 0; i--) {
      a[i] += a[i + 1];
      f[s[i - 1] - 'a'] += a[i];
    }
    for (int i = 0; i < 26; i++) cout << f[i] << " ";
    cout << "\n";
  }
}
int main() { fakemain(); }
