#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const int maxn = 200200;
char str[maxn];
int bit[maxn];
void add(int p, int v) {
  for (; p < maxn; p += p & -p) bit[p] += v;
}
set<int> where[maxn];
int n, m;
int get(int l) {
  int sum = 0, tmp = 0;
  for (int e = 20; e >= 0; e--) {
    if ((tmp | (1 << e)) > n) continue;
    if (sum + bit[tmp | (1 << e)] < l) {
      sum += bit[tmp | (1 << e)];
      tmp |= (1 << e);
    }
  }
  return tmp + 1;
}
int main() {
  scanf("%d %d", &n, &m);
  scanf("%s", str + 1);
  for (int e = 1; e <= n; e++) add(e, 1);
  for (int e = 1; e <= n; e++) where[str[e]].insert(e);
  for (int e = 0; e < m; e++) {
    int l, r;
    char c;
    scanf("%d %d %c", &l, &r, &c);
    l = get(l);
    r = get(r);
    while (true) {
      auto it = where[c].lower_bound(l);
      if (it == where[c].end() || *it > r) break;
      add(*it, -1);
      where[c].erase(it);
    }
  }
  for (int e = 1; e <= n; e++) {
    int sum = 0;
    for (int p = e; p; p -= p & -p) sum += bit[p];
    for (int p = e - 1; p; p -= p & -p) sum -= bit[p];
    if (sum) printf("%c", str[e]);
  }
  printf("\n");
  return 0;
}
