#include <bits/stdc++.h>
using namespace std;
class BIT {
 private:
  vector<int> bit;
  int maxval;

 public:
  BIT(int n = 0) {
    bit.assign(n + 10, 0);
    maxval = n;
  }
  void up(int v, int val = 1) {
    for (; v <= maxval; v += v & (-v)) bit[v] += val;
  }
  int get(int x) {
    int res = 0;
    for (; x; x -= x & (-x)) res += bit[x];
    return res;
  }
} bit(200000);
int n;
bool mark[200200];
int getpos(int x) {
  int l = 1, r = n;
  while (l < r) {
    int mid = (l + r) / 2;
    if (bit.get(mid) < x)
      l = mid + 1;
    else
      r = mid;
  }
  return l;
}
set<int> s[300];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string str;
  int q;
  memset(mark, true, sizeof mark);
  cin >> n >> q >> str;
  for (int i = 0; i < n; i++) {
    s[str[i]].insert(i + 1);
    bit.up(i + 1);
  }
  while (q--) {
    int ll, rr;
    char c;
    cin >> ll >> rr >> c;
    int l = getpos(ll), r = getpos(rr);
    set<int>::iterator it = s[c].lower_bound(l);
    while (it != s[c].end() && *it <= r) {
      bit.up(*it, -1);
      mark[*it] = false;
      set<int>::iterator next = ++it;
      it--;
      s[c].erase(it);
      it = next;
    }
  }
  for (int i = 1; i <= n; i++)
    if (mark[i]) cout << str[i - 1];
  return 0;
}
