#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long n, m, x, dis[N], sum = 0, arr[27], brr[2 * N];
vector<int> v[N], vv;
queue<int> q;
bool vis[N];
int main() {
  long long t;
  string s;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    cin >> s;
    for (int i = 0; i < n; i++) {
      arr[s[i] - 'a' + 1] += 1;
    }
    while (m--) {
      cin >> x;
      brr[1]++;
      brr[x + 1]--;
    }
    for (int i = 1; i <= n; i++) {
      brr[i] += brr[i - 1];
    }
    for (int i = 0; i < n; i++) {
      arr[s[i] - 'a' + 1] += brr[i + 1];
    }
    for (int i = 1; i <= 26; i++) {
      cout << arr[i] << " ";
      arr[i] = 0;
    }
    for (int i = 1; i <= n; i++) {
      brr[i] = 0;
    }
    cout << endl;
  }
}
