#include <bits/stdc++.h>
using namespace std;
const int N = 500023;
vector<long long int> adj[N];
void solve() {
  long long int n, m;
  cin >> n >> m;
  string str;
  cin >> str;
  vector<long long int> v;
  for (long long int i = 0; i < m; i++) {
    long long int x;
    cin >> x;
    x--;
    v.push_back(x);
  }
  long long int count[n + 1][26];
  for (long long int i = 0; i < n + 1; i++) {
    for (long long int j = 0; j < 26; j++) count[i][j] = 0;
  }
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < 26; j++) {
      if (i != 0) {
        if (str[i] == ('a' + j)) {
          count[i][j] = count[i - 1][j] + 1;
        } else {
          count[i][j] = count[i - 1][j];
        }
      } else {
        if (str[i] == ('a' + j)) {
          count[i][j] = 1;
        } else {
          count[i][j] = 0;
        }
      }
    }
  }
  long long int ans[26] = {0};
  for (long long int i = 0; i < m; i++) {
    for (long long int j = 0; j < 26; j++) ans[j] += count[v[i]][j];
  }
  for (long long int j = 0; j < 26; j++) {
    ans[j] += count[n - 1][j];
    cout << ans[j] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T;
  T = 1;
  cin >> T;
  long long int t = 0;
  while (t++ < T) {
    solve();
    cout << '\n';
  }
}
