#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
long long n, m, bit[1000005];
char c[200005];
set<long long> second[256];
void update(long long indx) {
  for (; indx <= 200000; indx += indx & (-indx)) {
    bit[indx]++;
  }
}
long long query(long long indx) {
  long long res = 0;
  for (; indx >= 1; indx -= indx & (-indx)) {
    res += bit[indx];
  }
  return res;
}
long long pos(long long i) {
  long long l = 1, r = 200000;
  while (l != r) {
    long long mid = (l + r) / 2;
    long long x = mid - query(mid);
    if (x < i) {
      l = mid + 1;
    } else
      r = mid;
  }
  return l;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> c[i];
    second[c[i]].insert(i);
  }
  while (m--) {
    long long l, r;
    char cc;
    cin >> l >> r >> cc;
    l = pos(l);
    r = pos(r);
    while (1) {
      auto it = second[cc].lower_bound(l);
      if (it == second[cc].end() || *(it) > r) {
        break;
      }
      update(*(it));
      second[cc].erase(it);
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (query(i) - query(i - 1) == 0) {
      cout << c[i];
    }
  }
}
