#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int bit[N], n, m, l, r, i, q[N], cnt, top, j, Hash[300], sz;
set<int> s[63];
char str[N], ss[N], ch;
void add(int x, int v) {
  while (x <= N - 3) bit[x] += v, x += x & -x;
}
int sum(int x, int res = 0) {
  while (x) res += bit[x], x -= x & -x;
  return res;
}
int ask(int rnk, int cur = 0, int k = 0) {
  for (int i = 20, tmp; i >= 0; --i)
    if (cur + (1 << i) <= N - 3) {
      tmp = cur + (1 << i);
      if (bit[tmp] + k < rnk) {
        k += bit[tmp];
        cur = tmp;
      }
    }
  return cur + 1;
}
int main() {
  for (ch = 'a'; ch <= 'z'; ++ch) Hash[ch] = ++sz;
  for (ch = 'A'; ch <= 'Z'; ++ch) Hash[ch] = ++sz;
  for (ch = '0'; ch <= '9'; ++ch) Hash[ch] = ++sz;
  for (scanf("%d%d%s", &n, &m, str + 1), i = 1, n = strlen(str + 1); i <= n;
       ++i)
    s[Hash[str[i]]].insert(i), add(i, 1);
  for (; m--;) {
    scanf("%d%d %c", &l, &r, &ch);
    l = ask(l);
    r = ask(r);
    top = 0;
    for (auto x = s[Hash[ch]].lower_bound(l); x != s[Hash[ch]].end(); ++x)
      if (*x > r)
        break;
      else
        q[++top] = *x;
    for (i = 1; i <= top; ++i) s[Hash[ch]].erase(q[i]), add(q[i], -1);
  }
  for (i = 1; i <= n; ++i)
    if (sum(i) - sum(i - 1)) ss[cnt++] = str[i];
  puts(ss);
}
