#include <bits/stdc++.h>
using namespace std;
int s[200010 << 2], rec[200010], n, m, ll, rr;
char str[200010], ch;
map<char, set<int> > mp;
void build(int l, int r, int rt) {
  s[rt] = r - l + 1;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
}
int query(int l, int r, int x, int rt) {
  if (l == r) return r;
  int mid = (l + r) >> 1;
  if (s[rt << 1] >= x)
    query(l, mid, x, rt << 1);
  else
    query(mid + 1, r, x - s[rt << 1], rt << 1 | 1);
}
void update(int l, int r, int x, int rt) {
  s[rt]--;
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (mid >= x) {
    update(l, mid, x, rt << 1);
  } else
    update(mid + 1, r, x, rt << 1 | 1);
}
int main() {
  scanf("%d%d", &n, &m);
  build(1, n, 1);
  getchar();
  for (int i = 1; i <= n; i++) {
    scanf("%c", &str[i]);
    mp[str[i]].insert(i);
  }
  while (m--) {
    scanf("%d%d %c", &ll, &rr, &ch);
    ll = query(1, n, ll, 1);
    rr = query(1, n, rr, 1);
    set<int>::iterator it = mp[ch].lower_bound(ll);
    while (it != mp[ch].end() && *it <= rr) {
      rec[*it] = 1;
      update(1, n, *it, 1);
      mp[ch].erase(it);
      it = mp[ch].lower_bound(ll);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!rec[i]) printf("%c", str[i]);
  }
  printf("\n");
}
