#include <bits/stdc++.h>
using namespace std;
class solution {
 public:
  void solve() {
    int t;
    cin >> t;
    while (t--) {
      int n, m;
      cin >> n >> m;
      string s;
      cin >> s;
      vector<int> v(m);
      for (int i = 0; i < m; i++) {
        cin >> v[i];
      }
      vector<int> ch(26, 0);
      vector<int> dp(n, 0);
      dp[0] = 1;
      for (int i = 0; i < m; i++) {
        dp[0]++;
        dp[v[i]]--;
      }
      for (int i = 0; i < n; i++) {
        int charecter = s[i] - 'a';
        if (i == 0) {
          ch[charecter] = dp[0];
        } else {
          dp[i] += dp[i - 1];
          ch[charecter] += dp[i];
        }
      }
      for (auto it : ch) {
        cout << it << " ";
      }
      cout << "\n";
    }
  }
};
int main() {
  ios::sync_with_stdio(0), cout.tie(0), cin.tie(0);
  long long i = 0;
  solution s;
  s.solve();
  return 0;
}
