#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7, INF = 0x3f3f3f3f;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long qpow(long long a, long long n) {
  long long r = 1 % P;
  for (a %= P; n; a = a * a % P, n >>= 1)
    if (n & 1) r = r * a % P;
  return r;
}
long long inv(long long first) {
  return first <= 1 ? 1 : inv(P % first) * (P - P / first) % P;
}
inline int rd() {
  int first = 0;
  char p = getchar();
  while (p < '0' || p > '9') p = getchar();
  while (p >= '0' && p <= '9') first = first * 10 + p - '0', p = getchar();
  return first;
}
const int N = 2e5 + 10;
int n, m;
char s[N];
struct _ {
  int v[64];
  void upd(int first) { v[0] -= v[first], v[first] = 0; }
  _ operator+(const _ &rhs) const {
    _ ret;
    for (int i = 0; i <= 63; ++i) ret.v[i] = v[i] + rhs.v[i];
    return ret;
  }
} tr[N << 2];
int get(char c) {
  if ('a' <= c && c <= 'z') return c - 'a' + 1;
  if ('A' <= c && c <= 'Z') return c - 'A' + 27;
  if ('0' <= c && c <= '9') return c - '0' + 53;
  throw;
}
void build(int o, int l, int r) {
  if (l == r)
    tr[o].v[get(s[l])] = tr[o].v[0] = 1;
  else {
    build((o << 1), l, ((l + r) >> 1)),
        build(((o << 1) | 1), ((l + r) >> 1) + 1, r);
    tr[o] = tr[(o << 1)] + tr[((o << 1) | 1)];
  }
}
void pd(int o) {
  for (int i = 1; i <= 63; ++i)
    if (!tr[o].v[i]) {
      tr[(o << 1)].upd(i);
      tr[((o << 1) | 1)].upd(i);
    }
}
void upd(int o, int l, int r, int ql, int qr, int first) {
  if (ql <= l && r <= qr) return tr[o].upd(first);
  pd(o);
  if (((l + r) >> 1) >= ql) upd((o << 1), l, ((l + r) >> 1), ql, qr, first);
  if (((l + r) >> 1) < qr)
    upd(((o << 1) | 1), ((l + r) >> 1) + 1, r, ql, qr, first);
  tr[o] = tr[(o << 1)] + tr[((o << 1) | 1)];
}
int find(int o, int l, int r, int k) {
  if (l == r) return l;
  pd(o);
  if (tr[(o << 1)].v[0] >= k) return find((o << 1), l, ((l + r) >> 1), k);
  return find(((o << 1) | 1), ((l + r) >> 1) + 1, r, k - tr[(o << 1)].v[0]);
}
void dfs(int o, int l, int r) {
  if (!tr[o].v[0]) return;
  if (l == r)
    putchar(s[l]);
  else
    pd(o), dfs((o << 1), l, ((l + r) >> 1)),
        dfs(((o << 1) | 1), ((l + r) >> 1) + 1, r);
}
int main() {
  scanf("%d%d%s", &n, &m, s + 1);
  build(1, 1, n);
  for (int i = 1; i <= m; ++i) {
    int l, r;
    char c;
    scanf("%d%d %c", &l, &r, &c);
    l = find(1, 1, n, l), r = find(1, 1, n, r);
    upd(1, 1, n, l, r, get(c));
  }
  dfs(1, 1, n), putchar(10);
}
