#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t = 1;
  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];
    long long arr[26][n + 1];
    memset(arr, 0, sizeof(arr));
    for (long long j = 0; j < 26; j++) {
      for (long long i = 1; i <= n; i++) {
        if (j == s[i - 1] - 'a')
          arr[j][i] = arr[j][i - 1] + 1;
        else
          arr[j][i] = arr[j][i - 1];
      }
    }
    long long k = 0;
    for (long long i = 0; i < 26; i++) {
      k = arr[i][n];
      for (long long j = 0; j < m; j++) {
        k += arr[i][a[j]];
      }
      cout << k << " ";
    }
    cout << '\n';
  }
}
