#include <bits/stdc++.h>
using namespace std;
int test;
int arr[26];
int main() {
  cin >> test;
  for (int i = 0; i < test; i++) {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    vector<int> p(n);
    for (int i = 0; i < 26; i++) {
      arr[i] = 0;
    }
    for (int j = 0; j < m; j++) {
      int val;
      cin >> val;
      p[val - 1]++;
    }
    int counter = 1;
    for (int a = n - 1; a >= 0; a--) {
      counter = counter + p[a];
      arr[s[a] - 'a'] += counter;
    }
    for (int r = 0; r < 26; r++) {
      if (r == 25) {
        cout << arr[25] << endl;
      } else {
        cout << arr[r] << " ";
      }
    }
  }
  return 0;
}
