#include <bits/stdc++.h>
using namespace std;
struct FenwickTree {
  vector<int> A;
  int MOD;
  FenwickTree(int size, int mod) {
    A.resize(size + 1, 0);
    MOD = mod;
  }
  int sum(int i) {
    i++;
    long long sum = 0;
    while (i > 0) {
      sum += A[i];
      i -= (i) & (-i);
    }
    return (int)(sum % MOD);
  }
  void add(int i, int k) {
    k %= MOD;
    i++;
    while (i < A.size()) {
      A[i] += k;
      A[i] %= MOD;
      i += (i) & (-i);
    }
  }
};
int main() {
  int n, m;
  string s, s1;
  cin >> n >> m >> s1;
  vector<set<int> > trees(128);
  FenwickTree ft(n + 1, 1000000000);
  for (int i = 0; i < n; i++) {
    trees[s1[i]].insert(i + 1);
    ft.add(i + 1, 1);
  }
  while (m--) {
    int le, ri;
    cin >> le >> ri >> s;
    int l = le, r = n, mid;
    while (l != r) {
      mid = (l + r) / 2;
      if (ft.sum(mid) >= le) {
        r = mid;
      } else {
        l = mid + 1;
      }
    }
    le = l;
    l = ri, r = n;
    while (l != r) {
      mid = (l + r) / 2;
      if (ft.sum(mid) >= ri) {
        r = mid;
      } else {
        l = mid + 1;
      }
    }
    ri = l;
    auto itlow = trees[s[0]].lower_bound(le);
    auto itup = trees[s[0]].upper_bound(ri);
    while (itlow != itup) {
      ft.add(*itlow, -1);
      itlow = trees[s[0]].erase(itlow);
    }
  }
  int pre = 0, temp;
  for (int i = 1; i <= n; i++) {
    temp = ft.sum(i);
    if (temp > pre) {
      cout << s1[i - 1];
      pre = temp;
    }
  }
  cout << endl;
  return 0;
}
