#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793;
const long long mod = 1e9 + 7;
int CASE = 1;
const int mxn = 1e5 + 1;
const long long infll = 1e18;
const int infi = 1e9;
bool prime(long long n) {
  if (n <= 1) return false;
  if (n == 2 or n == 3) return true;
  if (n % 2 == 0 or n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i += 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long __gcd(long long a, long long b) { return !b ? a : __gcd(b, a % b); }
long long power(long long a, long long b, long long MOD) {
  long long x = a, res = 1, p = b;
  while (p > 0) {
    if (p & 1) res *= x;
    x *= x;
    p >>= 1;
    x %= MOD, res %= MOD;
  }
  return res;
}
void solve() {
  vector<int> ans(26, 0);
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<int> cnt(26, 0);
  map<int, int> mp;
  for (long long i = 0; i < q; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  int i = 0;
  for (auto x : mp) {
    for (; i < x.first; i++) {
      cnt[s[i] - 'a']++;
    }
    for (long long j = 0; j < 26; j++) ans[j] += cnt[j] * x.second;
  }
  for (char c : s) ans[c - 'a']++;
  for (long long i = 0; i < 26; i++) cout << ans[i] << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
