#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::string;
void __Check(bool condition, const char* expression, int line) {
  if (!condition) {
    fprintf(stderr, "Check failed at line %d: %s\n", line, expression);
    exit(-1);
  }
}
template <class Collection, class Key>
bool ContainsKey(const Collection& collection, const Key& key) {
  return collection.find(key) != collection.end();
}
const int INF = 0x3F3F3F3F;
const int INIT = -1;
int n, m;
string s;
const int MAX = 2 * 1e5 + 7;
int pre[MAX][26];
int ans[26];
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    cin >> n >> m;
    cin >> s;
    std::memset(ans, 0, sizeof(ans));
    for (int j = 0; j < 26; j++) {
      pre[0][j] = 0;
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < 26; j++) {
        pre[i][j] = pre[i - 1][j];
      }
      uint8_t c = s[i - 1] - 'a';
      pre[i][c]++;
    }
    for (int i = 0; i < m; i++) {
      int p;
      cin >> p;
      for (int j = 0; j < 26; j++) {
        ans[j] += pre[p][j];
      }
    }
    for (int j = 0; j < 26; j++) {
      printf("%d ", ans[j] + pre[n][j]);
    }
    printf("\n");
  }
}
