#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)2e5 + 25;
int n, m;
string s;
int t[63][4 * maxn];
int have[4 * maxn];
int getVal(const char& c) {
  if ('0' <= c and c <= '9') {
    return (c - '0');
  }
  if ('A' <= c and c <= 'Z') {
    return (c - 'A' + 36);
  }
  return (c - 'a' + 10);
}
void build(int v, int vl, int vr) {
  if (vl == vr) {
    t[getVal(s[vl - 1])][v]++;
    have[v] = 1;
    return;
  }
  int mid = (vl + vr) >> 1;
  build(v + v, vl, mid);
  build(v + v + 1, mid + 1, vr);
  for (int i = 0; i < 62; i++) {
    t[i][v] = t[i][v + v] + t[i][v + v + 1];
  }
  have[v] = have[v + v] + have[v + v + 1];
}
void update(int v, int vl, int vr, int l, int r, int cur, int val) {
  if (t[val][v] == 0 or cur + 1 > r or cur + have[v] < l) return;
  if (vl == vr) {
    t[val][v] = have[v] = 0;
    return;
  }
  int mid = (vl + vr) >> 1;
  update(v + v + 1, mid + 1, vr, l, r, cur + have[v + v], val);
  update(v + v, vl, mid, l, r, cur, val);
  for (int i = 0; i < 62; i++) {
    t[i][v] = t[i][v + v] + t[i][v + v + 1];
  }
  have[v] = have[v + v] + have[v + v + 1];
}
void print(int v, int vl, int vr) {
  if (have[v] == 0) return;
  if (vl == vr) {
    cout << s[vl - 1];
    return;
  }
  int mid = (vl + vr) >> 1;
  print(v + v, vl, mid);
  print(v + v + 1, mid + 1, vr);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  cin >> s;
  build(1, 1, n);
  int left, right;
  char c;
  while (m--) {
    cin >> left >> right >> c;
    update(1, 1, n, left, right, 0, getVal(c));
  }
  print(1, 1, n);
  cout << "\n";
  return 0;
}
