#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
long long res[MAXN][30];
inline void Init() {
  ios::sync_with_stdio(false);
  cin.tie(0);
}
int main() {
  Init();
  int T;
  cin >> T;
  while (T--) {
    int N, M;
    long long c[30] = {0};
    string s;
    cin >> N >> M;
    cin >> s;
    for (int i = 0; i < 26; i++) res[0][i] = 0;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < 26; j++) res[i + 1][j] = res[i][j];
      res[i + 1][s[i] - 'a']++;
    }
    while (M--) {
      int x;
      cin >> x;
      for (int i = 0; i < 26; i++) c[i] += res[x][i];
    }
    for (int i = 0; i < 26; i++) c[i] += res[N][i];
    for (int i = 0; i < 26; i++) cout << c[i] << " ";
    cout << endl;
  }
  return 0;
}
