#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
void solve() {
  long long int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<long long int> p(m);
  for (int i = 0; i < m; i++) {
    cin >> p[i];
  }
  vector<vector<long long int>> v(n, vector<long long int>(26, 0));
  v[0][s[0] - 'a']++;
  for (int i = 1; i < n; i++) {
    v[i][s[i] - 'a']++;
    for (int j = 0; j < 26; j++) {
      v[i][j] += v[i - 1][j];
    }
  }
  map<long long int, long long int> m1;
  for (auto x : p) {
    m1[x]++;
  }
  long long int count = 0;
  vector<long long int> res(26, 0);
  for (auto x : m1) {
    long long int val = x.second;
    vector<long long int> v1 = v[x.first - 1];
    for (int i = 0; i < 26; i++) {
      res[i] += (val)*v1[i];
    }
  }
  for (int i = 0; i < n; i++) {
    res[s[i] - 'a']++;
  }
  for (auto x : res) {
    cout << x << " ";
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
