#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int d[maxn], sum[maxn], total[30];
char s[maxn];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t, i, j, m, n, x;
  cin >> t;
  while (t--) {
    memset(sum, 0, sizeof(sum));
    memset(d, 0, sizeof(d));
    memset(total, 0, sizeof(total));
    sum[0] = 1;
    cin >> n >> m;
    cin >> s;
    for (i = 1; i <= m; i++) {
      cin >> x;
      d[1] += 1;
      d[x + 1] -= 1;
    }
    for (i = 1; i <= n; i++) {
      sum[i] = sum[i - 1] + d[i];
    }
    for (i = strlen(s); i >= 1; i--) {
      s[i] = s[i - 1];
    }
    for (i = 1; i <= n; i++) {
      total[s[i] - 97] += sum[i];
    }
    for (i = 0; i < 26; i++) {
      if (i == 25) {
        cout << total[i] << endl;
      } else {
        cout << total[i] << " ";
      }
    }
  }
  return 0;
}
