#include <bits/stdc++.h>
using namespace std;
long long int dp[200001][27];
int main() {
  long long int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    long long int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    long long int a[m + 2];
    for (int j = 1; j <= m; j++) {
      cin >> a[j];
    }
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= 26; k++) {
        dp[j][k] = dp[j - 1][k];
      }
      long long int q = (s[j - 1] - 'a') + 1;
      dp[j][q]++;
    }
    a[m + 1] = n;
    for (int j = 1; j <= 26; j++) {
      long long int ans = 0;
      for (int k = 1; k <= m + 1; k++) {
        ans += dp[a[k]][j];
      }
      cout << ans << " ";
    }
    cout << endl;
  }
}
