#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 200000;
int seg[MAX_N * 4 + 10];
int SN;
set<int> at[200];
char s[MAX_N + 10];
bool del[MAX_N + 10];
void seg_init(int n) {
  SN = 1;
  while (SN < n) SN <<= 1;
  memset(seg, 0, sizeof(seg));
}
void seg_pull(int idx) { seg[idx] = seg[idx * 2 + 1] + seg[idx * 2 + 2]; }
void seg_build(int idx) {
  if (idx >= SN - 1) return;
  seg_build(idx * 2 + 1);
  seg_build(idx * 2 + 2);
  seg_pull(idx);
}
void seg_update(int a, int b, int x, int idx, int l, int r) {
  if (r <= a || l >= b) return;
  if (a <= l && r <= b) {
    seg[idx] = x;
    return;
  }
  int m = (l + r) / 2;
  seg_update(a, b, x, idx * 2 + 1, l, m);
  seg_update(a, b, x, idx * 2 + 2, m, r);
  seg_pull(idx);
}
int seg_query(int a, int b, int idx, int l, int r) {
  if (r <= a || l >= b) return 0;
  if (a <= l && r <= b) return seg[idx];
  int ans = 0;
  int m = (l + r) / 2;
  ans += seg_query(a, b, idx * 2 + 1, l, m);
  ans += seg_query(a, b, idx * 2 + 2, m, r);
  return ans;
}
int kth(int x) {
  int lb = 0, ub = 200000 + 10;
  while (ub - lb > 1) {
    int mid = (ub + lb) / 2;
    if (seg_query(0, mid, 0, 0, SN) >= x)
      ub = mid;
    else
      lb = mid;
  }
  return ub - 1;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  seg_init(n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    at[(int)s[i]].insert(i);
    seg[SN - 1 + i] = 1;
  }
  seg_build(0);
  for (int i = 0; i < m; i++) {
    int l, r;
    char ch[10];
    scanf("%d %d %s", &l, &r, ch);
    l = kth(l);
    r = kth(r);
    auto it = at[ch[0]].lower_bound(l);
    auto tmp = it;
    while (it != at[ch[0]].end() && *it <= r) {
      del[*it] = true;
      seg_update(*it, *it + 1, 0, 0, 0, SN);
      it++;
    }
    at[ch[0]].erase(tmp, it);
  }
  for (int i = 0; i < n; i++) {
    if (!del[i]) printf("%c", s[i]);
  }
  puts("");
  return 0;
}
