#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
int n, m;
char s[MAXN];
int L[MAXN], R[MAXN];
char C[MAXN];
int ind(char c) {
  if (c >= '0' && c <= '9') return c - '0';
  if (c >= 'a' && c <= 'z') return 10 + c - 'a';
  return 10 + 26 + c - 'A';
}
void load() {
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  for (int i = 0; i < m; i++) {
    scanf("%d%d %c", L + i, R + i, &C[i]);
    --L[i];
    --R[i];
  }
}
struct fenwick {
  int tree[MAXN];
  void update(int x, int val) {
    x += 1;
    for (; x < MAXN; x += x & -x) tree[x] += val;
  }
  int query(int x) {
    x += 1;
    int ret = 0;
    for (; x > 0; x -= x & -x) ret += tree[x];
    return ret;
  }
} fen;
int query(int x) {
  int lo = 0, hi = n - 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    if (fen.query(mid) >= x + 1)
      hi = mid;
    else
      lo = mid + 1;
  }
  return lo;
}
set<int> S[70];
void solve() {
  for (int i = 0; i < n; i++) fen.update(i, 1);
  for (int i = 0; i < n; i++) {
    S[ind(s[i])].insert(i);
  }
  for (int i = 0; i < m; i++) {
    int l = query(L[i]), r = query(R[i]);
    int id = ind(C[i]);
    auto it = S[id].lower_bound(l);
    while (it != S[id].end() && *it <= r) {
      auto it_ = next(it);
      fen.update(*it, -1);
      S[id].erase(it);
      it = it_;
    }
  }
  vector<pair<int, int> > v;
  for (int i = 0; i < 70; i++) {
    for (auto it = S[i].begin(); it != S[i].end(); ++it) {
      v.push_back(pair<int, int>(*it, i));
    }
  }
  sort(v.begin(), v.end());
  for (pair<int, int> p : v) {
    int x = p.second;
    char c;
    if (x < 10)
      c = '0' + x;
    else if (x < 10 + 26)
      c = 'a' + x - 10;
    else
      c = 'A' + x - 10 - 26;
    printf("%c", c);
  }
  printf("\n");
}
int main() {
  load();
  solve();
  return 0;
}
