#include <bits/stdc++.h>
using namespace std;
int vx[] = {0, 0, -1, 1};
int vy[] = {1, -1, 0, 0};
int dx[] = {1, 0, -1, 1, -1, 1, 0, -1};
int dy[] = {1, 1, 1, 0, 0, -1, -1, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
const long long mod = 1e9 + 7;
const int INF = INT_MAX / 2;
const int N_MAX = 100010;
int main() {
  int n, q;
  string str;
  vector<int> s;
  vector<int> t;
  vector<char> d;
  cin >> n >> q;
  cin >> str;
  for (int i = 0; i < int(n); i++) s.push_back(str[i] - 'A');
  for (int i = 0; i < int(q); i++) {
    char a, b;
    cin >> a >> b;
    t.push_back((int)(a - 'A'));
    d.push_back(b);
  }
  vector<vector<int> > position = vector<vector<int> >(26, vector<int>());
  for (int i = 0; i < int(n); i++) {
    position[s[i]].push_back(i);
  }
  vector<int> num = vector<int>(n, 1);
  int ans = 0;
  for (int i = 0; i < int(q); i++) {
    for (int j = 0; j < int(position[t[i]].size()); j++) {
      int p = position[t[i]][j];
      if (p == 0 && d[i] == 'L') {
        ans += num[p];
        num[p] = 0;
      } else if (p == n - 1 && d[i] == 'R') {
        ans += num[p];
        num[p] = 0;
      } else if (d[i] == 'L') {
        num[p - 1] += num[p];
        num[p] = 0;
      } else if (d[i] == 'R') {
        num[p + 1] += num[p];
        num[p] = 0;
      }
    }
    for (int i = 0; i < int(n); i++) {
      cout << num[i] << " ";
    }
    cout << endl;
  }
  cout << n - ans << endl;
  return 0;
}
