#include <bits/stdc++.h>
using namespace std;
int n, m, node[200005];
string a;
set<int> second[130];
stack<int> st;
char c;
void update(int h) {
  while (h <= n) node[h]++, h += (h & -h);
}
int GET(int h) {
  int x = 0;
  while (h) x += node[h], h -= (h & -h);
  return x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> a;
  for (int i = 0; i <= n - 1; ++i) {
    second[int(a[i])].insert(i + 1);
  }
  a = ' ' + a;
  int x, y, l, u;
  while (m) {
    cin >> x >> y >> c;
    l = int(c);
    set<int>::iterator it;
    it = second[l].lower_bound(x + GET(x));
    while (it != second[l].end() && *it - GET((*it) - 1) < x) it++;
    while (it != second[l].end() && *it - GET((*it) - 1) <= y) {
      u = *it;
      st.push(u);
      it++;
    }
    while (!st.empty()) {
      a.erase(st.top() - GET(st.top() - 1), 1);
      update(st.top());
      second[l].erase(st.top()), st.pop();
    }
    m--;
  }
  a.erase(0, 1);
  cout << a;
}
