#include <bits/stdc++.h>
using namespace std;
int n, m, tree[200005];
set<int> st[130];
set<int>::iterator it1, it2;
char s[200005], c;
vector<int> vt;
void update(int node, int val) {
  for (; node <= n; node += node & -node) tree[node] += val;
}
int query(int node) {
  int sum = 0;
  for (; node > 0; node -= node & -node) sum += tree[node];
  return sum;
}
int search(int num) {
  int lo = 1, hi = n, mid, tmp, lol;
  while (lo <= hi) {
    mid = (lo + hi) >> 1;
    tmp = query(mid);
    if (tmp >= num) {
      lol = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  return lol;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  for (int i = 48; i <= 122; i++) {
    st[i].insert(0);
    st[i].insert(200005);
  }
  for (int i = 0; i < n; i++) {
    st[s[i]].insert(i + 1);
    update(i + 1, 1);
  }
  for (int i = 1, l, r; i <= m; i++) {
    scanf("%d %d %c*c", &l, &r, &c);
    l = search(l), r = search(r);
    it1 = st[c].lower_bound(l);
    if (*it1 < l) it1++;
    it2 = st[c].lower_bound(r);
    if (*it2 > r) it2--;
    for (; *it1 <= *it2; it1++) vt.push_back(*it1);
    for (int j = 0; j < vt.size(); j++) {
      st[c].erase(vt[j]);
      update(vt[j], -1);
    }
    vt.clear();
  }
  for (int i = 48; i <= 122; i++) {
    for (it1 = st[i].begin(); it1 != st[i].end(); it1++) {
      if (*it1 > 0 && *it1 < 200005) vt.push_back(*it1);
    }
  }
  sort(vt.begin(), vt.end());
  int i = 0;
  for (; i < vt.size(); i++) {
    s[i] = s[vt[i] - 1];
  }
  s[i] = '\0';
  printf("%s\n", s);
  return 0;
}
