#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main() {
  int N, Q;
  cin >> N >> Q;
  int golem[N];
  char place[N];
  char mover;
  char direction;
  int res = 0;
  for (int i = 0; i < N; ++i) {
    golem[i] = i + 1;
  }
  for (int i = 0; i < N; ++i) {
    cin >> place[i];
  }
  for (int i = 0; i < Q; ++i) {
    cin >> mover;
    cin >> direction;
    for (int j = 0; j < N; ++j) {
      if (place[j] == mover) {
        for (int k = 0; k < N; ++k) {
          if (k == golem[k]) {
            if (direction == 'R') {
              golem[k] = golem[k] + 1;
            }
            if (direction == 'L') {
              golem[k] = golem[k] - 1;
            }
          }
        }
      }
    }
  }
  for (int i = 0; i < N; ++i) {
    cout << golem[i] << endl;
    if ((golem[i] < 0) || (golem[i]) > N) {
      res++;
    }
  }
  cout << res;
}
