#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const unsigned long long INF = 1e18;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast();
  fast();
  long long t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    long long a[m];
    for (long long i = 0; i < m; i++) {
      cin >> a[i];
    }
    sort(a, a + m);
    long long f[26] = {0};
    for (long long i = 0; i < n; i++) {
      long long x = upper_bound(a, a + m, i) - a;
      x = m - x;
      f[s[i] - 'a'] += x + 1;
    }
    for (long long i = 0; i < 26; i++) cout << f[i] << " ";
    cout << "\n";
  }
}
