#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void run() {
  ll n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<ll> p;
  for (ll i = 0; i < m; ++i) {
    ll x;
    cin >> x;
    p.push_back(x);
  }
  sort(p.begin(), p.end());
  vector<ll> res(26, 0);
  ++m;
  ll currs = 0;
  ll currp = 0;
  while (currs < n) {
    auto chr = s[currs];
    while (currp < p.size() && currs == p[currp]) {
      --m;
      ++currp;
    }
    res[chr - 'a'] += m;
    ++currs;
  }
  cout << res[0];
  for (int i = 1; i < 26; ++i) cout << ' ' << res[i];
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) run();
  return 0;
}
