#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
char s[N];
int dp[N];
long long rep[30];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    scanf("%d%d", &n, &m);
    scanf("%s", s + 1);
    for (int i = 0; i <= n; i++) {
      dp[i] = 0;
    }
    memset(rep, 0, sizeof rep);
    int p;
    for (int i = 0; i < m; i++) {
      scanf("%d", &p);
      dp[p + 1]--;
    }
    dp[0] = m + 1;
    for (int i = 1; i <= n; i++) {
      dp[i] += dp[i - 1];
      rep[s[i] - 'a'] += dp[i];
    }
    for (int i = 0; i < 26; i++) {
      printf("%lld ", rep[i]);
    }
    printf("\n");
  }
  return 0;
}
