#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
inline int lowbit(int x) { return x & -x; }
const int maxn = 2e5 + 10;
struct FenwickTree {
  int n;
  vector<int> C;
  void resize(int n) {
    this->n = n;
    C.resize(n + 1);
  }
  void clear() { fill(C.begin(), C.end(), 0); }
  void init(int n) {
    resize(n);
    clear();
  }
  int sum(int x) {
    int ret = 0;
    while (x > 0) {
      ret += C[x];
      x -= lowbit(x);
    }
    return ret;
  }
  void add(int x, int d) {
    while (x <= n) {
      C[x] += d;
      x += lowbit(x);
    }
  }
} so;
int n, m;
set<int> s[64];
map<char, int> id;
char re[64];
char c[maxn];
int find(int cur) {
  int l = 0, r = n;
  while (r - l > 1) {
    int mid = (l + r) >> 1;
    if (so.sum(mid) >= cur)
      r = mid;
    else
      l = mid;
  }
  if (so.sum(l) == cur)
    return l;
  else
    return r;
}
struct no {
  char c;
  int n;
  bool operator<(const no& s) const { return n < s.n; }
};
int main() {
  cin >> n >> m;
  scanf("%s", c + 1);
  so.init(n + 1);
  for (int i = 1; i <= n; ++i) so.add(i, 1);
  int cnt = 0;
  for (int i = (0); i < (26); ++i) {
    re[cnt] = i + 'A', id[i + 'A'] = cnt++;
    re[cnt] = i + 'a', id[i + 'a'] = cnt++;
  }
  for (int i = (0); i < (10); ++i) re[cnt] = i + '0', id[i + '0'] = cnt++;
  for (int t = (1); t < (n + 1); ++t) s[id[c[t]]].insert(t);
  int l, r;
  char cc;
  while (m--) {
    scanf("%d%d %c", &l, &r, &cc);
    l = find(l), r = find(r);
    int w = id[cc];
    auto i = s[w].lower_bound(l), j = s[w].upper_bound(r);
    while (i != j) {
      so.add(*i, -1);
      s[w].erase(i++);
    }
  }
  vector<no> ans;
  for (int t = (0); t < (cnt); ++t) {
    for (auto r : s[t]) ans.push_back(no{re[t], r});
  }
  sort(ans.begin(), ans.end());
  for (auto r : ans) printf("%c", r.c);
}
