#include <bits/stdc++.h>
using namespace std;
const int N = 3 + 2e5;
struct {
  int l, r;
  int cnt[62];
  bitset<62> laz;
} tr[N << 2];
int n, m;
char cc;
int str(int x) {
  if (isdigit(x)) return x - '0';
  if (islower(x)) return x - 'a' + 10;
  return x - 'A' + 36;
}
void up(int k) {
  for (int i = 0; i < 62; ++i)
    tr[k].cnt[i] = tr[(k << 1)].cnt[i] + tr[(k << 1 | 1)].cnt[i];
}
void down(int k) {
  for (int i = 0; i < 62; ++i) {
    if (tr[k].laz[i]) {
      tr[(k << 1)].cnt[i] = tr[(k << 1 | 1)].cnt[i] = 0;
      tr[(k << 1)].laz[i] = tr[(k << 1 | 1)].laz[i] = 1;
      tr[k].laz[i] = 0;
    }
  }
}
void build(int k, int l, int r) {
  tr[k].l = l;
  tr[k].r = r;
  if (l == r) {
    scanf("%c", &cc);
    ++tr[k].cnt[str(cc)];
    return;
  }
  int mid = l + r >> 1;
  build((k << 1), l, mid);
  build((k << 1 | 1), mid + 1, r);
  up(k);
}
int query(int k, int kk) {
  if (tr[k].l == tr[k].r) return tr[k].r;
  down(k);
  int cnt = 0;
  for (int i = 0; i < 62; ++i) cnt += tr[(k << 1)].cnt[i];
  if (cnt >= kk) return query((k << 1), kk);
  return query((k << 1 | 1), kk - cnt);
}
void clear(int k, int l, int r, int cc) {
  if (l <= tr[k].l && tr[k].r <= r) {
    tr[k].cnt[cc] = 0;
    tr[k].laz[cc] = 1;
    return;
  }
  down(k);
  int mid = tr[k].l + tr[k].r >> 1;
  if (l <= mid) clear((k << 1), l, r, cc);
  if (r > mid) clear((k << 1 | 1), l, r, cc);
  up(k);
}
void print(int k) {
  if (tr[k].l == tr[k].r) {
    for (int i = 0; i < 10; ++i)
      if (tr[k].cnt[i]) {
        putchar(i + '0');
        return;
      }
    for (int i = 10; i < 36; ++i)
      if (tr[k].cnt[i]) {
        putchar(i - 10 + 'a');
        return;
      }
    for (int i = 36; i < 62; ++i)
      if (tr[k].cnt[i]) {
        putchar(i - 36 + 'A');
        return;
      }
    return;
  }
  down(k);
  print((k << 1));
  print((k << 1 | 1));
}
int main() {
  scanf("%d%d", &n, &m);
  getchar();
  build(1, 1, n);
  int l, r;
  while (m--) {
    scanf("%d%d %c", &l, &r, &cc);
    int Left = query(1, l);
    int Right = query(1, r);
    clear(1, Left, Right, str(cc));
  }
  print(1);
  return 0;
}
