#include <bits/stdc++.h>
#pragma GCC optimize "O3"
using namespace std;
constexpr int N = 200010;
int n, m;
long long s[N + 1];
char str[N];
inline int lb(int x) { return x & -x; }
void update(int x, long long d) {
  while (x <= n) {
    s[x] += d;
    x += lb(x);
  }
}
int query(int x) {
  long long rtn = 0;
  while (x > 0) {
    rtn += s[x];
    x -= lb(x);
  }
  return rtn;
}
int bs(int x) {
  int l = 1, r = n;
  while (l < r) {
    int mid = (l + r) / 2;
    int y = query(mid);
    if (y >= x)
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
set<int> st[128];
int main() {
  scanf("%d %d", &n, &m);
  scanf("%s", str + 1);
  for (int i = 1; i <= n; ++i) st[str[i]].insert(i);
  for (int i = 1; i <= n; ++i) update(i, 1);
  for (int i = 0; i < m; ++i) {
    char ch[2];
    int l, r;
    scanf("%d %d %s", &l, &r, ch);
    l = bs(l);
    r = bs(r);
    auto lit = st[ch[0]].lower_bound(l);
    auto rit = st[ch[0]].upper_bound(r);
    for (auto it = lit; it != rit;) {
      update(*it, -1);
      st[ch[0]].erase(it++);
    }
  }
  int prv = 0;
  for (int i = 1; i <= n; ++i) {
    int x = query(i);
    if (x != prv) {
      printf("%c", str[i]);
      prv = x;
    }
  }
  puts("");
}
