#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int maxn = 2e5 + 5;
set<int> s[65];
int getidx(char c) {
  if (c >= 'A' && c <= 'Z')
    return c - 'A';
  else if (c >= 'a' && c <= 'z')
    return c - 'a' + 26;
  else
    return c - '0' + 52;
}
char str[maxn];
int n, m, c[maxn];
void add(int x, int v) {
  for (int i = x; i <= n; i += i & -i) c[i] += v;
}
int sum(int x) {
  int s = 0;
  for (int i = x; i; i -= i & -i) s += c[i];
  return s;
}
int del[maxn];
bool vis[maxn];
int getnpos(int x) {
  int l = 1, r = n, pos = -1;
  while (l <= r) {
    int mid = l + r >> 1;
    if (sum(mid) >= x)
      pos = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  return pos;
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%s", str + 1);
  for (int i = (1); i <= (n); i++) s[getidx(str[i])].insert(i);
  for (int i = (1); i <= (n); i++) add(i, 1);
  while (m--) {
    int l, r;
    char c[2];
    scanf("%d", &l);
    scanf("%d", &r);
    scanf("%s", c);
    int now = getidx(c[0]);
    l = getnpos(l);
    r = getnpos(r);
    int cnt = 0;
    for (auto it = s[now].lower_bound(l); it != s[now].end(); it++) {
      if (*it > r) break;
      del[++cnt] = *it;
    }
    for (int i = (1); i <= (cnt); i++) {
      s[now].erase(del[i]);
      vis[del[i]] = 1;
      add(del[i], -1);
    }
  }
  for (int i = (1); i <= (n); i++)
    if (!vis[i]) cout << str[i];
}
