#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void pn(T... args) {
  ((cout << args << " "), ...);
  cout << "\n";
}
template <typename... T>
void ps(T... args) {
  ((cout << args << " "), ...);
  cout << "";
}
long long power(long long a, long long b, long long P = 1000000007) {
  long long res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % P)
    if (b & 1) res = 1ll * res * a % P;
  return res;
}
void solve() {
  long long n, m, a;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<long long> arr(n, 0);
  for (long long i = 0; i < m; i++) {
    cin >> a;
    arr[a - 1]++;
  }
  long long cnt = 1;
  long long ans[26] = {};
  for (long long i = n - 1; i >= 0; i--) {
    cnt += arr[i];
    ans[s[i] - 'a'] += cnt;
  }
  for (auto j : ans) cout << j << " ";
  cout << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
