#include <bits/stdc++.h>
using namespace std;
long long n, m;
string str;
vector<long long> sum;
void Input() {
  cin >> n >> m >> str, sum.clear(), sum.resize(n);
  fill(sum.begin(), sum.end(), 0);
  for (long long i = 0; i < m; i++) {
    long long d;
    cin >> d;
    sum[d - 1]++;
  }
}
void Solve() {
  long long ans[26] = {0};
  for (long long i = n - 2; i >= 0; i--) sum[i] = sum[i + 1] + sum[i];
  for (long long i = 0; i < n; i++) ans[str[i] - 'a'] += sum[i] + 1;
  for (long long i = 0; i < 26; i++) cout << ans[i] << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  cin >> T;
  while (T--) {
    Input();
    Solve();
  }
  return 0;
}
