#include <bits/stdc++.h>
using namespace std;
int n, m;
string s, nS;
map<char, long long> a;
map<long long, char> b;
vector<long long> t;
void build(int i, int L, int R) {
  if (L == R) {
    char ch = s[L];
    t[i] = a[ch];
  } else {
    int M = (L + R) / 2;
    build(2 * i + 1, L, M);
    build(2 * i + 2, M + 1, R);
    t[i] = t[2 * i + 1] | t[2 * i + 2];
  }
}
void query(int i, int L, int R, int l, int r, char ch) {
  if (L == R) {
    if (t[i] & a[ch]) t[i] -= a[ch], n -= 1;
  } else if (t[i] & a[ch]) {
    int M = (L + R) / 2;
    if (l <= M) query(2 * i + 1, L, M, l, min(M, r), ch);
    if (r > M) query(2 * i + 2, M + 1, R, max(M + 1, l), r, ch);
    t[i] = t[2 * i + 1] | t[2 * i + 2];
  }
}
void rebuild(int i, int L, int R) {
  if (!t[i]) return;
  if (L == R) {
    if (t[i]) {
      char ch = b[t[i]];
      s += ch;
    }
  } else {
    int M = (L + R) / 2;
    rebuild(2 * i + 1, L, M);
    rebuild(2 * i + 2, M + 1, R);
  }
}
int main() {
  for (char ch = '0'; ch <= '9'; ch++)
    a[ch] = 1LL << (ch - '0'), b[1LL << (ch - '0')] = ch;
  for (char ch = 'a'; ch <= 'z'; ch++)
    a[ch] = 1LL << (ch - 'a' + 10), b[1LL << (ch - 'a' + 10)] = ch;
  for (char ch = 'A'; ch <= 'Z'; ch++)
    a[ch] = 1LL << (ch - 'A' + 36), b[1LL << (ch - 'A' + 36)] = ch;
  scanf("%d %d", &n, &m);
  t.resize(4 * n);
  cin >> s;
  build(0, 0, n - 1);
  for (int i = 0; i < m; i++) {
    int l, r;
    char ch;
    scanf("%d %d %c", &l, &r, &ch);
    l--, r--;
    int oldN = n;
    query(0, 0, n - 1, l, r, ch);
    if (n == 0) {
      cout << endl;
      return 0;
    }
    if (oldN != n) {
      s = "";
      rebuild(0, 0, oldN - 1);
      build(0, 0, n - 1);
    }
  }
  cout << s << endl;
  return 0;
}
