#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, m;
int tree[N];
string str, tmp;
set<int> G[80];
int lowbit(int x) { return x & (-x); }
void Add(int x) {
  while (x <= n) {
    tree[x]++;
    x += lowbit(x);
  }
}
int Query(int x) {
  int ret = 0;
  while (x > 0) {
    ret += tree[x];
    x -= lowbit(x);
  }
  return ret;
}
int Find_pos(int pos) {
  int l = pos, r = n;
  while (l <= r) {
    int m = l + r >> 1;
    int num = Query(m);
    if (m == num + pos && str[m] != '.') {
      return m;
    } else if (m < num + pos)
      l = m + 1;
    else
      r = m - 1;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  cin >> str;
  set<int>::iterator it;
  str = "#" + str;
  for (int i = 1; i <= n; i++) G[str[i] - '0'].insert(i);
  int l, r;
  while (m--) {
    cin >> l >> r >> tmp;
    if (l + tree[1] > n) continue;
    if (l == r)
      l = r = Find_pos(l);
    else {
      l = Find_pos(l);
      if (r + tree[1] > n)
        r = n;
      else
        r = Find_pos(r);
    }
    int pos = tmp[0] - '0';
    it = G[pos].begin();
    while (it != G[pos].end()) {
      int index = *it;
      if (index >= l && index <= r) {
        Add(index);
        str[index] = '.';
        it = G[pos].erase(it);
      } else
        it++;
      if (index > r) break;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (str[i] != '.') cout << str[i];
  }
  cout << endl;
  return 0;
}
