#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 2e5 + 5;
char t[MAXN];
int n, m;
int tree[MAXN];
void add(int i, int x) {
  while (i <= n) tree[i] += x, i += i & -i;
}
int query(int i) {
  int ret = 0;
  while (i) ret += tree[i], i -= i & -i;
  return ret;
}
int Find(int x) {
  int l = 1, r = n;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (mid - query(mid) < x)
      l = mid + 1;
    else
      r = mid - 1;
  }
  return r + 1;
}
char ans[MAXN];
int main() {
  set<int> s[150];
  scanf("%d %d %s", &n, &m, t + 1);
  for (int i = 1; i <= n; i++) s[t[i]].insert(i);
  for (int i = 1; i <= m; i++) {
    int l, r;
    char c[2];
    scanf("%d %d %s", &l, &r, c);
    int reall = Find(l), realr = Find(r);
    auto p = s[c[0]].lower_bound(reall), q = s[c[0]].upper_bound(realr);
    while (p != q) {
      add(*p, 1);
      s[c[0]].erase(p++);
    }
  }
  for (int i = 1; i < 150; i++)
    for (auto p : s[i]) ans[p] = i;
  for (int i = 1; i <= n; i++)
    if (ans[i]) printf("%c", ans[i]);
  puts("");
  return 0;
}
