#include <bits/stdc++.h>
using namespace std;
inline int get(char c) {
  if (isdigit(c))
    return c - '0';
  else if (islower(c))
    return c - 'a' + 10;
  else
    return c - 'A' + 36;
}
inline char reget(int c) {
  if (c < 10)
    return c + '0';
  else if (c < 36)
    return c - 10 + 'a';
  else
    return c - 36 + 'A';
}
int BIT[200005];
int n, m;
inline void ins(int p, int v = 1) {
  while (p <= n) {
    BIT[p] += v;
    p += p & -p;
  }
}
inline int cnt(int p) {
  int res = 0;
  while (p > 0) {
    res += BIT[p];
    p -= p & -p;
  }
  return res;
}
inline int Fpos(int num) {
  int l = num, r = n;
  while (l < r) {
    int m = (l + r) >> 1;
    if (m - cnt(m) < num)
      l = m + 1;
    else
      r = m;
  }
  return l;
}
set<int> s[62];
bool rem[200005];
int main() {
  ios::sync_with_stdio(false);
  memset(BIT, 0, sizeof(BIT));
  cin >> n >> m;
  string second;
  cin >> second;
  for (int i = 0; i < n; ++i) {
    int c = get(second[i]);
    s[c].insert(i + 1);
  }
  for (int i = 0; i < m; ++i) {
    int l, r;
    char C;
    cin >> l >> r >> C;
    l = Fpos(l);
    r = Fpos(r);
    int c = get(C);
    set<int>::iterator it = s[c].lower_bound(l);
    set<int>::iterator it0 = it;
    while (it != s[c].end() && (*it) <= r) {
      ins(*it);
      rem[*it] = 1;
      ++it;
    }
    s[c].erase(it0, it);
  }
  for (int i = 1; i <= n; ++i) {
    if (!rem[i]) cout << second[i - 1];
  }
  cout << endl;
  return 0;
}
