#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)2e5 + 5;
char str[MAXN];
int p[MAXN], n, m, mark[MAXN];
set<int> s[200];
void add(int x, int y) {
  while (x <= n) {
    p[x] += y;
    x += x & (-x);
  }
}
int getsum(int x) {
  int re = 0;
  while (x) {
    re += p[x];
    x -= x & (-x);
  }
  return re;
}
int getidx(int x) {
  int re, l = 1, r = n;
  while (l <= r) {
    int mid = l + r >> 1;
    if (getsum(mid) >= x) {
      re = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return re;
}
void work(int l, int r, int x) {
  set<int>::iterator it;
  it = s[x].lower_bound(l);
  while (it != s[x].end() && *it <= r) {
    add(*it, -1);
    mark[*it] = 0;
    s[x].erase(it++);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", str + 1);
  for (int i = 1; i <= n; i++) {
    add(i, 1);
    mark[i] = 1;
    s[str[i]].insert(i);
  }
  while (m--) {
    int l, r, x;
    char c[2];
    scanf("%d%d%s", &l, &r, c);
    x = c[0];
    l = getidx(l);
    r = getidx(r);
    work(l, r, x);
  }
  for (int i = 1; i <= n; i++)
    if (mark[i]) printf("%c", str[i]);
  printf("\n");
  return 0;
}
