#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& o, const pair<T, U>& x) {
  o << "(" << x.first << ", " << x.second << ")";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const vector<T>& x) {
  o << "[";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "]";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const set<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const multiset<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const unordered_set<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T>
ostream& operator<<(ostream& o, const unordered_multiset<T>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const map<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const multimap<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const unordered_map<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
template <typename T, typename U>
ostream& operator<<(ostream& o, const unordered_multimap<T, U>& x) {
  o << "{";
  int b = 0;
  for (auto& a : x) o << (b++ ? ", " : "") << a;
  o << "}";
  return o;
}
double time() { return double(clock()) / CLOCKS_PER_SEC; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    string s;
    cin >> n >> m >> s;
    vector<int> X(m);
    for (auto& x : X) cin >> x, x--;
    sort(begin(X), end(X));
    vector<int> ans(256);
    for (int i = 0, j = 1; i < n; i++) {
      while (j <= m and X[m - j] == n - i - 1) j++;
      ans[s[n - i - 1]] += j;
    }
    for (int i = 'a'; i <= 'z'; i++) cout << ans[i] << " \n"[i == 'z'];
  }
}
