#include <bits/stdc++.h>
using namespace std;
using namespace std;
map<int, int> start, end;
using namespace std;
using namespace std;
const int maxn = 2 * 100005;
int bit[maxn];
char s[maxn];
int n, q;
void upd(int ind, int d) {
  ind++;
  while (ind < maxn) {
    bit[ind] += d;
    ind += ind & -ind;
  }
}
int sum(int ind) {
  ind++;
  int s = 0;
  while (ind > 0) {
    s += bit[ind];
    ind -= ind & -ind;
  }
  return s;
}
int getBoundR(int l) {
  int lo = 0, hi = n - 1;
  int b = 0;
  while (lo <= hi) {
    int mid = lo + (hi - lo) / 2;
    if (sum(mid) <= l)
      b = mid, lo = mid + 1;
    else
      hi = mid - 1;
  }
  return b;
}
int getBoundL(int l) {
  int lo = 0, hi = n - 1;
  int b = 0;
  while (lo <= hi) {
    int mid = lo + (hi - lo) / 2;
    if (sum(mid) >= l)
      b = mid, hi = mid - 1;
    else
      lo = mid + 1;
  }
  return b;
}
set<int> pos[27 * 3];
map<char, int> mp;
int id = 0;
int getID(char c) {
  if (mp.find(c) == mp.end()) mp[c] = id++;
  return mp[c];
}
int main() {
  scanf("%d %d", &n, &q);
  scanf("%s", s);
  for (int i = 0; i < n; ++i) {
    int node = getID(s[i]);
    pos[node].insert(i);
    upd(i, 1);
  }
  while (q--) {
    int l, r;
    char c;
    scanf("%d %d %c", &l, &r, &c);
    l = getBoundL(l), r = getBoundR(r);
    int node = getID(c);
    set<int>::iterator it = pos[node].lower_bound(l);
    vector<set<int>::iterator> its;
    while (it != pos[node].end() && *it <= r) {
      its.push_back(it);
      upd(*it, -1);
      it++;
    }
    for (int i = 0; i < ((int)((its).size())); i++) pos[node].erase(its[i]);
  }
  for (int i = 0; i < n; ++i) {
    if (sum(i) > sum(i - 1)) printf("%c", s[i]);
  }
}
