#include <bits/stdc++.h>
using namespace std;
int n, m, l, r, md, x, d[200005];
vector<int> b[70];
string a, ans;
bool v[200005];
char g[5];
int e(char p) {
  if (p >= '0' && p <= '9') return p - '0';
  if (p >= 'A' && p <= 'Z') return p - 'A' + 10;
  return p - 'a' + 36;
}
int f(int p) {
  int s = 0;
  while (p > 0) {
    s += d[p];
    p -= (p & -p);
  }
  return s;
}
void u(int p) {
  while (p <= n) {
    d[p]++;
    p += (p & -p);
  }
}
int main() {
  int i, t, t1, t2, z, st, en;
  cin >> n >> m;
  cin >> a;
  a = ' ' + a;
  for (i = 1; i <= n; i++) {
    b[e(a[i])].push_back(i);
  }
  while (m--) {
    scanf("%d %d %s", &t1, &t2, g);
    l = 1;
    r = n + 1;
    x = n;
    while (l < r) {
      md = (l + r) / 2;
      t = md - f(md);
      if (t < t1) {
        l = md + 1;
      } else {
        r = md;
        x = md;
      }
    }
    t1 = x;
    l = 1;
    r = n + 1;
    x = n;
    while (l < r) {
      md = (l + r) / 2;
      t = md - f(md);
      if (t < t2) {
        l = md + 1;
      } else {
        r = md;
        x = md;
      }
    }
    t2 = x;
    z = e(g[0]);
    st = lower_bound(b[z].begin(), b[z].end(), t1) - b[z].begin();
    en = upper_bound(b[z].begin(), b[z].end(), t2) - b[z].begin();
    for (i = st; i < en; i++) {
      if (v[b[z][i]]) continue;
      v[b[z][i]] = 1;
      u(b[z][i]);
    }
  }
  for (i = 1; i <= n; i++)
    if (!v[i]) ans += a[i];
  cout << ans;
  return 0;
}
