#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 1e9 + 7;
const long long LINF = 1e18;
const double PI = 3.1415926535897932384626433832795;
long double START_TIME, TIME;
const int MAX_SIZE = 5e5;
map<char, long long> M;
void fast_in_out() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  START_TIME = clock();
}
void make() {
  char c = 'a';
  while (c != 'z') {
    M[c] = 0;
    c = c + 1;
  }
  M[c] = 0;
}
void solve() {
  int n, m;
  string s;
  cin >> n >> m >> s;
  make();
  vector<int> p(m), c(n, 0);
  for (auto& i : p) {
    cin >> i;
    ++c[i - 1];
  }
  int x = 1;
  for (int i = n - 1; i > -1; --i) {
    c[i] += x;
    x = max(x, c[i]);
    M[s[i]] += c[i];
  }
  for (auto& i : M) {
    cout << i.second << ' ';
  }
  cout << '\n';
}
int main() {
  fast_in_out();
  TIME = (clock() - START_TIME) / CLOCKS_PER_SEC;
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  cerr << '\n' << TIME << " sec." << '\n';
  return 0;
}
