#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T a) {
  return ((a < 0) ? -a : a);
}
template <typename T>
inline T sqr(T a) {
  return a * a;
}
template <class T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T sign(T a) {
  return a > 0 ? 1 : (a < 0 ? -1 : 0);
}
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &p) {
  return out << "(" << p.first << ", " << p.second << ")";
};
template <class A>
ostream &operator<<(ostream &out, const vector<A> &v) {
  out << "[";
  for (int i = int(0); i < int(int((v).size())); ++i) {
    if (i) out << ", ";
    out << v[i];
  }
  return out << "]";
}
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
const int dxK[] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int dyK[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dxKn[] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int dyKn[] = {1, 2, 2, 1, -1, -2, -2, -1};
const int INF = int(1e9) + 100;
const long long INF64 = int(1e18) + 100;
const long double EPS = 1e-9;
const long double PI = acosl(-1.0);
const int N = 400 * 1000 + 9;
int getID(char c) {
  if (islower(c)) return c - 'a';
  if (isupper(c)) return 26 + c - 'A';
  return 52 + c - '0';
}
int n, m;
string st;
set<int> s[N];
pair<int, int> p[N];
char c[N];
int t[4 * N];
inline bool read() {
  if (!(cin >> n >> m)) return false;
  cin >> st;
  for (int i = int(0); i < int(m); ++i) {
    cin >> p[i].first >> p[i].second >> c[i];
    --p[i].first, --p[i].second;
  }
  return true;
}
void build(int v, int l, int r) {
  if (r - l == 1) {
    t[v] = 1;
    return;
  }
  int mid = (l + r) / 2;
  build(v * 2 + 1, l, mid), build(v * 2 + 2, mid, r);
  t[v] = t[v * 2 + 1] + t[v * 2 + 2];
}
void dfs(int v, int l, int r) {
  if (r - l == 1) {
    if (l >= int((st).size()))
      while (true)
        ;
    if (t[v]) cout << st[l];
    return;
  }
  int mid = (l + r) / 2;
  dfs(v * 2 + 1, l, mid);
  dfs(v * 2 + 2, mid, r);
}
int get(int v, int l, int r, int rem) {
  if (r - l == 1) {
    if (t[v] != 1 || rem != 0)
      while (true)
        ;
    return l;
  }
  int mid = (l + r) / 2;
  if (t[v * 2 + 1] > rem)
    return get(v * 2 + 1, l, mid, rem);
  else
    return get(v * 2 + 2, mid, r, rem - t[v * 2 + 1]);
}
int get(int rem) { return get(0, 0, n, rem); }
void upd(int v, int l, int r, int pos, int d) {
  if (r - l == 1) {
    if (l != pos)
      while (true)
        ;
    t[v] = d;
    return;
  }
  int mid = (l + r) / 2;
  if (pos < mid)
    upd(v * 2 + 1, l, mid, pos, d);
  else
    upd(v * 2 + 2, mid, r, pos, d);
  t[v] = t[v * 2 + 1] + t[v * 2 + 2];
}
void upd(int pos, int d) { upd(0, 0, n, pos, d); }
void del(int l, int r, int c) {
  while (true) {
    if (s[c].empty()) return;
    auto it = s[c].lower_bound(l);
    if (it == s[c].end() || *it >= r) return;
    upd(*it, 0);
    s[c].erase(*it);
  }
}
inline void solve() {
  build(0, 0, n);
  for (int i = int(0); i < int(n); ++i) s[getID(st[i])].insert(i);
  for (int i = int(0); i < int(m); ++i) {
    int l = get(p[i].first), r = get(p[i].second) + 1;
    del(l, r, getID(c[i]));
  }
  dfs(0, 0, n);
}
int main() {
  cout << fixed << setprecision(15);
  cerr << fixed << setprecision(15);
  if (read()) {
    solve();
  }
  return 0;
}
