#include <bits/stdc++.h>
using namespace std;
long long n, b, x, q, t, ans, l, r, m, p, now, sum;
bool ok;
string s;
map<int, int> a, pos;
map<char, int> c;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> q;
  while (q--) {
    cin >> n >> m;
    cin >> s;
    for (int i = 1; i <= m; ++i) {
      cin >> x;
      a[x + 1]++;
    }
    sum = m + 1;
    for (int i = 0; i < s.size(); ++i) {
      sum -= a[i + 1];
      c[s[i]] += sum;
    }
    for (char j = 'a'; j <= 'z'; ++j) {
      cout << c[j] << ' ';
    }
    cout << '\n';
    a.clear();
    c.clear();
  }
  return 0;
}
