#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int n, m;
int bit[(int)2e5 + 100];
void update(int i) {
  for (; i <= n; i += (i & (-i))) bit[i]++;
}
int q(int i) {
  int sum = 0;
  for (; i; i -= (i & (-i))) sum += bit[i];
  return sum;
}
int getIndex(int i) {
  int l = 1, r = n, idx;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (mid >= q(mid) + i)
      idx = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  return idx;
}
map<char, multiset<int> > a;
multiset<int>::iterator it, it2;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> n >> m >> s;
  for (int i = 0; i < n; i++) a[s[i]].insert(i + 1);
  for (int i = 0; i < m; i++) {
    int l, r;
    char c;
    cin >> l >> r >> c;
    l = getIndex(l);
    r = getIndex(r);
    it = a[c].lower_bound(l);
    while (it != a[c].end() && *it <= r) {
      it2 = it;
      it++;
      update(*it2);
      a[c].erase(it2);
    }
  }
  vector<pair<int, char> > res;
  for (auto ch : a)
    for (auto x : ch.second) res.push_back(make_pair(x, ch.first));
  sort(res.begin(), res.end());
  for (auto x : res) cout << x.second;
  cout << '\n';
  return 0;
}
