#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
long long test, n, r, m, k, x, y, q, z, d, ans, a[N], b[N];
string s;
void solve() {
  int n, m;
  cin >> n >> m >> s;
  for (long long i = 0; i <= 25; i++) b[i] = 0;
  for (long long i = 0; i <= n + 1; i++) a[i] = 0;
  for (long long i = 1; i <= m; i++) {
    cin >> x;
    a[x - 1]++;
  }
  for (long long i = n - 1, c = 0; i >= 0; i--) {
    c += a[i];
    b[s[i] - 'a'] += 1 + c;
  }
  for (int i = 0; i <= 25; i++) cout << b[i] << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> test;
  while (test--) solve();
}
