#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 200;
set<int> g[256];
int n, m;
char s[maxn];
int c[maxn], vis[maxn];
int lowbit(int x) { return x & (-x); }
void add(int x, int val) {
  while (x <= n) {
    c[x] += val;
    x += lowbit(x);
  }
}
int sum(int x) {
  int ans = 0;
  while (x > 0) {
    ans += c[x];
    x -= lowbit(x);
  }
  return ans;
}
int Find(int x) {
  int l = 1, r = n, ans;
  while (l <= r) {
    int mid = (l + r) >> 1;
    int cnt = sum(mid);
    if (cnt == x) {
      ans = mid;
      r = mid - 1;
    } else if (cnt > x)
      r = mid - 1;
    else
      l = mid + 1;
  }
  return ans;
}
int main() {
  scanf("%d%d%s", &n, &m, s + 1);
  for (int i = 1; i <= n; i++) add(i, 1);
  for (int i = 1; i <= n; i++) g[(int)s[i]].insert(i);
  int l, r;
  char op[5];
  while (m--) {
    scanf("%d%d%s", &l, &r, op);
    l = Find(l);
    r = Find(r);
    set<int>::iterator it = g[(int)op[0]].lower_bound(l);
    while (it != g[(int)op[0]].end()) {
      int x = (*it);
      if (x > r) break;
      add(x, -1);
      vis[x] = 1;
      g[(int)op[0]].erase(it++);
      if (x == r) break;
    }
  }
  for (int i = 1; i <= n; i++)
    if (vis[i] == 0) printf("%c", s[i]);
  return 0;
}
