#include <bits/stdc++.h>
using namespace std;
long long a, b, c[200005], d[200005], e, f, mx, mn = 1e9, ct = 0, sum, n, t,
                                                mn2, ct2, h[26], dif, ans;
string s, p, m;
char ch[26];
bool kk, k;
int main() {
  cin >> t;
  while (t--) {
    map<char, int> mp;
    for (int i = 0; i < 200005; i++) c[i] = 0;
    cin >> a >> b >> s;
    for (int i = 0; i < b; i++) {
      cin >> d[i];
      c[d[i]]--;
    }
    c[0] = b;
    for (int i = 1; i < a; i++) {
      c[i] = c[i - 1] + c[i];
    }
    for (int i = 0; i < a; i++) {
      c[i]++;
    }
    for (int i = 0; i < a; i++) {
      mp[s[i]] += c[i];
    }
    for (int i = 0; i < 26; i++) {
      char ch = 'a' + i;
      cout << mp[ch] << " ";
    }
    cout << endl;
  }
  return 0;
}
