#include <bits/stdc++.h>
using namespace std;
long long modpow(long long b, long long e, long long mod) {
  long long ans = 1;
  for (; e; b = b * b % mod, e /= 2)
    if (e & 1) ans = ans * b % mod;
  return ans;
}
const int N = 200005;
struct ST {
  vector<int> st;
  int n;
  ST(int n) : st(2 * n, 0), n(n) {}
  void upd(int pos, int val) {
    for (st[pos += n] = val; pos /= 2;) st[pos] = st[2 * pos] + st[2 * pos + 1];
  }
  int query(int x, int y) {
    int ans = 0;
    for (x += n, y += n + 1; x < y; x /= 2, y /= 2) {
      if (x & 1) ans += st[x++];
      if (y & 1) ans += st[--y];
    }
    return ans;
  }
};
ST seg(N);
map<char, set<int> > pos;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  for (int i = 1; i < ((int)(s).size() + 1); ++i) {
    pos[s[i - 1]].insert(i);
    seg.upd(i, 1);
  }
  while (m--) {
    int l, r;
    char c;
    cin >> l >> r >> c;
    int L = 1, R = n;
    int lf = -1;
    while (L <= R) {
      int mid = (L + R) / 2;
      if (seg.query(1, mid) >= l) {
        lf = mid;
        R = mid - 1;
      } else
        L = mid + 1;
    }
    l = lf;
    L = 1, R = n;
    lf = -1;
    while (L <= R) {
      int mid = (L + R) / 2;
      if (seg.query(1, mid) >= r) {
        lf = mid;
        R = mid - 1;
      } else
        L = mid + 1;
    }
    r = lf;
    while ((int)(pos[c]).size()) {
      auto u = pos[c].lower_bound(l);
      if (u == end(pos[c])) break;
      if (*u > r) {
        break;
      } else {
        seg.upd(*u, 0);
        pos[c].erase(u);
      }
    }
  }
  vector<pair<int, char> > ans;
  for (auto w : pos) {
    for (auto k : w.second) {
      ans.push_back({k, w.first});
    }
  }
  sort(begin(ans), end(ans));
  for (int i = 0; i < ((int)(ans).size()); ++i) {
    cout << ans[i].second;
  }
}
