#include <bits/stdc++.h>
using namespace std;
const int maxN = 3e5 + 4;
int n, m, loga;
bool vis[maxN];
char str[maxN];
set<int> Set[256];
int aib[maxN];
inline int lsb(int x) { return x & (-x); }
void update(int pos, int val) {
  for (int i = pos; i <= loga; i += lsb(i)) aib[i] += val;
}
int query(int val) {
  int sum = 0;
  for (int i = loga >> 1; i > 0; i >>= 1)
    if (aib[sum + i] < val) {
      val -= aib[sum + i];
      sum += i;
    }
  return sum + 1;
}
int main() {
  scanf("%d%d%s", &n, &m, str + 1);
  for (int i = 1; i <= n; i++) Set[str[i]].insert(i);
  for (loga = 1; loga < n; loga <<= 1)
    ;
  for (int i = 1; i <= n; i++) update(i, 1);
  while (m--) {
    int st, dr;
    char ch;
    scanf("%d %d %c", &st, &dr, &ch);
    st = query(st);
    dr = query(dr);
    for (set<int>::iterator it = Set[ch].lower_bound(st);
         it != Set[ch].end() && *it <= dr;) {
      vis[*it] = true;
      update(*it, -1);
      Set[ch].erase(it++);
    }
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) printf("%c", str[i]);
  return 0;
}
