#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
struct BIT {
  long long n;
  long long MAX;
  vector<long long> bit;
  BIT() {}
  BIT(long long _n) {
    n = _n;
    MAX = n + 2;
    bit.resize(n + 10, 0);
  }
  long long query(long long x) {
    long long r = 0;
    while (x > 0) {
      r += bit[x];
      x -= (x & -x);
    }
    return r;
  }
  long long query(long long l, long long r) { return query(r) - query(l - 1); }
  void update(long long x, long long val) {
    while (x < MAX) {
      bit[x] += val;
      x += (x & -x);
    }
  }
  long long find_kth(long long k) {
    long long sum = 0;
    long long pos = 0;
    for (long long i = 20; i >= 0; i--) {
      if (pos + (1LL << i) > n) continue;
      long long atual = bit[pos + (1LL << i)];
      if (sum + atual < k) {
        sum += atual;
        pos += (1LL << i);
      }
    }
    return pos + 1;
  }
};
const long long N = 200100;
char s[N];
set<long long> pos[100];
long long get(char c) {
  if (c >= 'a' and c <= 'z') return c - 'a';
  if (c >= 'A' and c <= 'Z') return c - 'A' + 26;
  return c - '0' + 52;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  BIT T(n + 10);
  for (long long i = 1; i <= n; i++) T.update(i, 1);
  for (long long i = 1; i <= n; i++) cin >> s[i];
  for (long long i = 1; i <= n; i++) {
    pos[get(s[i])].insert(i);
  }
  for (long long i = 0; i < m; i++) {
    long long l, r;
    cin >> l >> r;
    char c;
    cin >> c;
    l = T.find_kth(l);
    r = T.find_kth(r);
    long long t = get(c);
    long long op = 0;
    while (true) {
      set<long long>::iterator it = pos[t].lower_bound(l);
      if (it == pos[t].end() or *it > r) break;
      T.update(*it, -1);
      pos[t].erase(*it);
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (T.query(i, i) == 1) {
      cout << s[i];
    }
  }
  cout << "\n";
}
