#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 200000 + 10, maxn = 200000 + 10, inf = 0x3f3f3f3f;
int sum[N], n, m;
void add(int x, int v) {
  while (x < N) {
    sum[x] += v;
    x += x & (-x);
  }
}
int query(int x) {
  int ans = 0;
  while (x > 0) {
    ans += sum[x];
    x -= x & (-x);
  }
  return ans;
}
int change(int x) {
  int l = 0, r = n + 1;
  while (l < r - 1) {
    int m = (l + r) >> 1;
    if (query(m) >= x)
      r = m;
    else
      l = m;
  }
  return r;
}
set<int> s[123];
bool vis[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string p;
  cin >> n >> m >> p;
  for (int i = 0; i < n; i++) {
    add(i + 1, 1);
    s[p[i]].insert(i + 1);
  }
  while (m--) {
    int l, r;
    string te;
    cin >> l >> r >> te;
    l = change(l), r = change(r);
    int id = te[0];
    auto x = s[id].lower_bound(l);
    for (; x != s[id].end();) {
      if ((*x) > r) break;
      add((*x), -1);
      s[id].erase(x++);
    }
  }
  for (int i = 0; i < 123; i++)
    for (auto x : s[i]) vis[x - 1] = 1;
  for (int i = 0; i < n; i++)
    if (vis[i]) cout << p[i];
  cout << "\n";
  return 0;
}
