#include <bits/stdc++.h>
using namespace std;
void Karl_Heinrich_Marx() { ios_base::sync_with_stdio(0); }
int n, m, l, r, bit[200005];
char a[200005], c;
map<char, set<int> > Map;
map<char, set<int> >::iterator it;
set<int>::iterator it1, it2;
bool dd[200005] = {};
void update(int x, int val) {
  dd[x] = 1;
  while (x <= n) {
    bit[x] += val;
    x += (x & -x);
  }
}
int get(int x) {
  int sum = 0;
  while (x) {
    sum += bit[x];
    x -= (x & -x);
  }
  return sum;
}
int ask(int key) {
  int dau = 1, cuoi = n, mid;
  while (dau < cuoi) {
    mid = (dau + cuoi) / 2;
    if (mid - get(mid) >= key)
      cuoi = mid;
    else
      dau = mid + 1;
  }
  return dau;
}
void Vladimir_Ilyich_Lenin() {
  cin >> n >> m;
  for (int i = (1); i <= (n); i++) {
    cin >> a[i];
    Map[a[i]].insert(i);
  }
  for (int i = (1); i <= (m); i++) {
    cin >> l >> r >> c;
    l = ask(l);
    r = ask(r);
    it = Map.find(c);
    if (it == Map.end()) continue;
    it1 = (it->second).lower_bound(l);
    while (it1 != (it->second).end()) {
      if ((*it1) > r) break;
      update((*it1), 1);
      it2 = it1;
      it2++;
      (it->second).erase(it1);
      it1 = it2;
    }
  }
  for (int i = (1); i <= (n); i++)
    if (!dd[i]) cout << a[i];
}
int main() {
  Karl_Heinrich_Marx();
  Vladimir_Ilyich_Lenin();
  return 0;
}
