#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int g[70][N], mp[300];
char str[N];
int ft[N], n, m;
int sum(int p) {
  int ans = 0;
  for (int i = p; i > 0; i -= (i & (-i))) {
    ans += ft[i];
  }
  return ans;
}
void upd(int p, int x) {
  for (int i = p; i <= n; i += (i & (-i))) {
    ft[i] += x;
  }
}
int bs(int k) {
  int lo = 0, hi = n;
  while (hi - lo > 1) {
    int mi = (lo + hi) / 2;
    if (sum(mi) >= k) {
      hi = mi;
    } else {
      lo = mi;
    }
  }
  return hi;
}
int main() {
  scanf("%d %d", &n, &m);
  scanf("%s", str + 1);
  memset(ft, 0, sizeof ft);
  int cnt = 0;
  for (int i = '0'; i <= '9'; i++) {
    mp[i] = cnt++;
  }
  for (int i = 'a'; i <= 'z'; i++) {
    mp[i] = cnt++;
  }
  for (int i = 'A'; i <= 'Z'; i++) {
    mp[i] = cnt++;
  }
  set<int> pos[cnt];
  for (int i = 1; i <= n; i++) {
    upd(i, 1);
    pos[mp[str[i]]].insert(i);
  }
  for (int i = 0; i < m; i++) {
    int nl, nr, l, r;
    char x;
    scanf("%d %d %c", &nl, &nr, &x);
    l = bs(nl);
    r = bs(nr);
    vector<int> vec;
    for (auto it = pos[mp[x]].lower_bound(l);
         it != pos[mp[x]].end() && *it <= r; it++) {
      vec.push_back(*it);
      upd(*it, -1);
    }
    for (auto i : vec) {
      pos[mp[x]].erase(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (sum(i) - sum(i - 1) == 1) {
      putchar(str[i]);
    }
  }
  putchar('\n');
  return 0;
}
