#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int maxn = (int)2e5 + 10;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long mod = (long long)1e9 + 7;
int n, m, tr[maxn];
int cti(char c) {
  if (c >= 'a' && c <= 'z') return c - 'a';
  if (c >= 'A' && c <= 'Z') return c - 'A' + 26;
  return c - '0' + 52;
}
namespace BIT {
void upd(int x, int v) {
  while (x <= n) {
    tr[x] += v;
    x += x & -x;
  }
}
int qr(int x) {
  int r = 0;
  while (x) {
    r += tr[x];
    x -= x & -x;
  }
  return r;
}
int qry(int x) {
  int l = 1, r = n, mid = l + r >> 1;
  while (r - l > 1) {
    if (qr(mid) >= x)
      r = mid;
    else
      l = mid;
    mid = l + r >> 1;
  }
  if (qr(l) >= x)
    return l;
  else if (qr(mid) >= x)
    return mid;
  return r;
}
}  // namespace BIT
string s;
struct Seg {
  int l, r, sum[62];
} t[maxn << 2];
void pushup(int rt) {
  for (int i = 0; i < 62; i++) {
    t[rt].sum[i] = t[rt << 1].sum[i] + t[rt << 1 | 1].sum[i];
  }
}
void build(int l, int r, int rt) {
  t[rt].l = l, t[rt].r = r;
  if (l == r) {
    t[rt].sum[cti(s[l - 1])] = 1;
    return;
  }
  int mid = l + r >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  pushup(rt);
}
void upd(int L, int R, char c, int rt) {
  if (t[rt].l == t[rt].r) {
    BIT::upd(t[rt].l, -1);
    t[rt].sum[cti(c)] = 0;
    return;
  }
  int mid = t[rt].l + t[rt].r >> 1;
  if (L <= mid && t[rt << 1].sum[cti(c)]) upd(L, R, c, rt << 1);
  if (R > mid && t[rt << 1 | 1].sum[cti(c)]) upd(L, R, c, rt << 1 | 1);
  pushup(rt);
}
void print(int rt) {
  if (t[rt].l == t[rt].r) {
    for (int i = 0; i < 62; i++) {
      if (t[rt].sum[i]) {
        if (i < 26)
          cout << char('a' + i);
        else if (i < 52)
          cout << char('A' + i - 26);
        else
          cout << char('0' + i - 52);
      }
    }
    return;
  }
  int mid = t[rt].l + t[rt].r >> 1;
  print(rt << 1);
  print(rt << 1 | 1);
}
int main() {
  cin >> n >> m >> s;
  for (int i = 1; i <= n; i++) {
    BIT::upd(i, 1);
  }
  build(1, n, 1);
  while (m--) {
    int l, r;
    char c;
    cin >> l >> r >> c;
    l = BIT::qry(l);
    r = BIT::qry(r);
    upd(l, r, c, 1);
  }
  print(1);
  puts("");
}
