#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int inf = 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
int n, m;
string s;
set<int> q[100];
set<int>::iterator it, it1;
bool used[N];
int ch(char x) {
  if (x >= 'a' && x <= 'z') return x - 'a';
  if (x >= 'A' && x <= 'Z') return x - 'A' + 26;
  return x - '0' + 52;
}
int t[N];
void update(int pos, int delta) {
  for (; pos <= n; pos += (pos & -pos)) {
    t[pos] += delta;
  }
}
int sum(int x) {
  int answ = 0;
  for (; x >= 1; x -= (x & -x)) {
    answ += t[x];
  }
  return answ;
}
int sum(int l, int r) { return sum(r) - sum(l - 1); }
int main() {
  cin >> n >> m;
  cin >> s;
  for (int i = 0; i < (int)s.size(); i++) {
    int x = ch(s[i]);
    q[x].insert(i + 1);
    update(i + 1, 1);
  }
  while (m--) {
    int l, r;
    char id;
    scanf("%d%d", &l, &r);
    cin >> id;
    int x = ch(id);
    int ina = 1, inb = n, ind1 = -1;
    while (ina <= inb) {
      int mid = (ina + inb) / 2;
      if (sum(1, mid) >= l) {
        ind1 = mid;
        inb = mid - 1;
      } else
        ina = mid + 1;
    }
    ina = 1;
    inb = n;
    int ind2 = -1;
    while (ina <= inb) {
      int mid = (ina + inb) / 2;
      if (sum(1, mid) <= r) {
        ind2 = mid;
        ina = mid + 1;
      } else
        inb = mid - 1;
    }
    it = q[x].lower_bound(ind1);
    it1 = it;
    while (it != q[x].end() && *it <= ind2) {
      update(*it, -1);
      ++it;
    }
    if (it1 == it) continue;
    q[x].erase(it1, it);
  }
  for (int i = 0; i < 62; i++) {
    for (it = q[i].begin(); it != q[i].end(); ++it) {
      used[*it] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    if (used[i + 1]) cout << s[i];
  }
  cout << endl;
  return 0;
}
