#include <bits/stdc++.h>
using namespace std;
vector<int> seg(5000000), lazy(5000000);
string s;
int n, m;
void build(vector<int> &seg, vector<int> &lazy, int node, int b, int e) {
  if (b == e) {
    seg[node] = b;
    lazy[node] = 0;
    return;
  }
  int m = (b + e) >> 1;
  build(seg, lazy, 2 * node, b, m);
  build(seg, lazy, 2 * node + 1, m + 1, e);
  seg[node] = seg[2 * node];
  lazy[node] = 0;
}
void update(vector<int> &seg, vector<int> &lazy, int node, int b, int e, int i,
            int j, int val) {
  if (lazy[node]) {
    seg[node] -= lazy[node];
    if (b != e) {
      lazy[2 * node] += lazy[node];
      lazy[2 * node + 1] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (b > j || e < i) return;
  if (b >= i && e <= j) {
    seg[node] -= val;
    if (b != e) {
      lazy[2 * node] += val;
      lazy[2 * node + 1] += val;
    }
    return;
  }
  int m = (b + e) >> 1;
  update(seg, lazy, 2 * node, b, m, i, j, val);
  update(seg, lazy, 2 * node + 1, m + 1, e, i, j, val);
  seg[node] = seg[2 * node];
}
int query(vector<int> &seg, vector<int> &lazy, int node, int b, int e,
          int index) {
  if (lazy[node]) {
    seg[node] -= lazy[node];
    if (b != e) {
      lazy[2 * node] += lazy[node];
      lazy[2 * node + 1] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (b == e) {
    return b;
  }
  int m = (b + e) >> 1;
  if ((seg[2 * node + 1] - lazy[2 * node + 1]) > index)
    return query(seg, lazy, 2 * node, b, m, index);
  else
    return query(seg, lazy, 2 * node + 1, m + 1, e, index);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  cin >> s;
  build(seg, lazy, 1, 0, n - 1);
  map<char, vector<int> > mp;
  for (int i = 0; i < n; i++) {
    if (mp.find(s[i]) == mp.end()) {
      mp[s[i]] = vector<int>();
    }
    mp[s[i]].push_back(i);
  }
  while (m--) {
    int i, j;
    char c;
    cin >> i >> j >> c;
    i = query(seg, lazy, 1, 0, n - 1, i - 1) + 1;
    j = query(seg, lazy, 1, 0, n - 1, j - 1) + 1;
    int h = (lower_bound(mp[c].begin(), mp[c].end(), i - 1) - mp[c].begin());
    for (int k = h; k < mp[c].size(); k++) {
      if (mp[c][k] < j && s[mp[c][k]] != '#') {
        s[mp[c][k]] = '#';
        if (mp[c][k] < n - 1) {
          update(seg, lazy, 1, 0, n - 1, mp[c][k] + 1, n - 1, 1);
        }
      }
    }
  }
  string ans = "";
  for (int i = 0; i < n; i++) {
    if (s[i] != '#') ans += s[i];
  }
  cout << ans << "\n";
}
