#include <bits/stdc++.h>
using namespace std;
int n, m, flag[200005], q[200005];
char s[200005];
set<int> h[305];
struct node {
  int size;
} t[200005 * 4];
class seg_tree {
  void update(int x) {
    int lc = x << 1, rc = lc + 1;
    t[x].size = t[lc].size + t[rc].size;
  }

 public:
  void build(int x, int l, int r) {
    if (l == r) {
      t[x].size = 1;
      return;
    }
    int mid = l + r >> 1, lc = x << 1, rc = lc + 1;
    build(lc, l, mid);
    build(rc, mid + 1, r);
    update(x);
  }
  int qry(int x, int l, int r, int des) {
    if (l == r) return l;
    int mid = l + r >> 1, lc = x << 1, rc = lc + 1;
    if (des <= t[lc].size) return qry(lc, l, mid, des);
    return qry(rc, mid + 1, r, des - t[lc].size);
  }
  void modify(int x, int l, int r, int des) {
    if (l == r) {
      t[x].size = 0;
      return;
    }
    int mid = l + r >> 1, lc = x << 1, rc = lc + 1;
    if (des <= mid)
      modify(lc, l, mid, des);
    else
      modify(rc, mid + 1, r, des);
    update(x);
  }
} T;
int main() {
  int l, r, tot;
  char c;
  scanf("%d%d %s", &n, &m, s + 1);
  for (int i = 1; i <= n; i++) h[s[i]].insert(i);
  for (int i = 1; i <= 300; i++) h[i].insert(0), h[i].insert(n + 1);
  T.build(1, 1, n);
  while (m--) {
    scanf("%d%d %c", &l, &r, &c);
    l = T.qry(1, 1, n, l);
    r = T.qry(1, 1, n, r);
    set<int>::iterator x = h[c].lower_bound(l);
    while ((*x) < l) ++x;
    tot = 0;
    for (; (*x) <= r; ++x) q[++tot] = (*x);
    for (int i = 1; i <= tot; i++)
      h[c].erase(q[i]), flag[q[i]] = 1, T.modify(1, 1, n, q[i]);
  }
  for (int i = 1; i <= n; i++)
    if (!flag[i]) printf("%c", s[i]);
  printf("\n");
  return 0;
}
