#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int arr[N][26], ans[26];
bool vis[N];
char str[N];
queue<int> q;
int main() {
  int tmp, n, m = 0;
  scanf("%d", &tmp);
  while (tmp--) {
    for (int i = 1; i <= m; i++) {
      memset(arr[i], 0, sizeof(arr[i]));
    }
    memset(ans, 0, sizeof(ans));
    scanf("%d%d", &m, &n);
    scanf("%s", str + 1);
    for (int i = 0, f; i < n; i++) {
      scanf("%d", &f);
      vis[f] = true;
      q.push(f);
    }
    for (int i = 1; i <= m; i++) {
      int word = str[i] - 'a';
      for (int j = 0; j < 26; j++) {
        arr[i][j] = arr[i - 1][j];
        if (word == j) {
          arr[i][j]++;
        }
      }
      ans[word]++;
    }
    while (q.size()) {
      int f = q.front();
      q.pop();
      for (int i = 0; i < 26; i++) {
        ans[i] += arr[f][i];
      }
    }
    for (int i = 0; i < 26; i++) {
      printf("%d%c", ans[i], (i == 25 ? '\n' : ' '));
      ;
    }
  }
  return 0;
}
