#include <bits/stdc++.h>
using namespace std;
const int M = (int)2e5 + 5;
set<int> st[128];
set<int>::iterator it, it1;
char S[M], A[5];
int n, m;
int mark[M];
int val[M * 4];
void build(int L, int R, int p) {
  val[p] = R - L + 1;
  if (L == R) return;
  int mid = (L + R) >> 1;
  build(L, mid, p << 1), build(mid + 1, R, p << 1 | 1);
}
void update(int L, int R, int p, int x) {
  val[p]--;
  if (L == R) return;
  int mid = (L + R) >> 1;
  if (mid >= x)
    update(L, mid, p << 1, x);
  else
    update(mid + 1, R, p << 1 | 1, x);
}
int query(int L, int R, int p, int v) {
  if (L == R) return L;
  int mid = (L + R) >> 1;
  if (val[p << 1] >= v)
    return query(L, mid, p << 1, v);
  else
    return query(mid + 1, R, p << 1 | 1, v - val[p << 1]);
}
int main() {
  scanf("%d %d", &n, &m);
  build(1, n, 1);
  scanf("%s", S + 1);
  for (int i = 1; i <= n; i++) st[(int)S[i]].insert(i);
  for (int i = 1, l, r, x; i <= m; i++) {
    scanf("%d %d", &l, &r);
    l = query(1, n, 1, l);
    r = query(1, n, 1, r);
    scanf("%s", A);
    x = A[0];
    for (it = st[x].lower_bound(l); it != st[x].end() && (*it) <= r;) {
      it1 = it;
      update(1, n, 1, (*it1));
      it++;
      st[x].erase(it1);
    }
  }
  for (int i = 0; i < 128; i++)
    for (it = st[i].begin(); it != st[i].end(); it++) mark[(*it)] = 1;
  for (int i = 1; i <= n; i++)
    if (mark[i]) putchar(S[i]);
  putchar('\n');
  return 0;
}
