#include <bits/stdc++.h>
using namespace std;
void _print(long long int t) { cerr << t; }
void _print(int t) { cerr << t; }
void _print(string t) { cerr << t; }
void _print(char t) { cerr << t; }
void _print(long double t) { cerr << t; }
void _print(double t) { cerr << t; }
template <class T, class V>
void _print(pair<T, V> p) {
  cerr << "{";
  _print(p.first);
  cerr << ",";
  _print(p.second);
  cerr << "}";
}
template <class T>
void _print(vector<T> v) {
  cerr << "[";
  for (T i : v) {
    _print(i);
    cerr << " ";
  }
  cerr << "]";
}
const int INF = 1e6 + 1;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    long long int arr[m];
    for (long long int i = 0; i < m; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + m);
    vector<long long int> freq(n + 1, 0);
    freq[n] = 1;
    for (long long int i = m - 1; i >= 0; i--) {
      freq[arr[i]]++;
    }
    for (long long int i = n - 1; i > 0; i--) {
      freq[i] += freq[i + 1];
    }
    vector<long long int> ans(26, 0);
    for (long long int i = 0; i < n; i++) {
      ans[s[i] - 'a'] += freq[i + 1];
    }
    for (long long int j : ans) {
      cout << j << " ";
    }
    cout << "\n";
  }
}
