#include <bits/stdc++.h>
using namespace std;
set<int> b[127];
set<int>::iterator it, itt;
int n, m, l, r, c[200005];
char s, ch[2], a[200005];
void upd(int v, int d) {
  while (v <= n) {
    c[v] += d;
    v += v & -v;
  }
}
int find(int x) {
  int cur = 0, ans = 0;
  for (int i = 20; i >= 0; i--) {
    ans += (1 << i);
    if (ans >= n || cur + c[ans] >= x)
      ans -= (1 << i);
    else
      cur += c[ans];
  }
  return ans + 1;
}
int gsum(int v) {
  int sum = 0;
  while (v > 0) {
    sum += c[v];
    v -= v & -v;
  }
  return sum;
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", a + 1);
  for (int i = 1; i <= n; i++) b[a[i]].insert(i);
  for (int i = 1; i <= n; i++) upd(i, 1);
  for (int i = 0; i < m; i++) {
    scanf("%d%d%s", &l, &r, ch);
    s = ch[0];
    l = find(l);
    r = find(r);
    it = b[s].lower_bound(l);
    while (it != b[s].end() && *it <= r)
      upd(*it, -1), a[*it] = '#', itt = it, it++, b[s].erase(itt);
  }
  for (int i = 1; i <= n; i++)
    if (gsum(i) - gsum(i - 1) == 1) printf("%c", a[i]);
  printf("\n");
  return 0;
}
