#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 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;
    bool flag = (l == r);
    if (l + tree[1] > n)
      l = n + 1;
    else {
      int ll = l, rr = n;
      while (ll <= rr) {
        int mm = ll + rr >> 1;
        int num = Query(mm);
        if (mm == num + l && str[mm] != '.') {
          l = mm;
          break;
        } else if (mm < num + l)
          ll = mm + 1;
        else
          rr = mm - 1;
      }
    }
    if (flag)
      r = l;
    else {
      if (r + tree[1] > n)
        r = n;
      else {
        int ll = r, rr = n;
        while (ll <= rr) {
          int mm = ll + rr >> 1;
          int num = Query(mm);
          if (mm == num + r && str[mm] != '.') {
            r = mm;
            break;
          } else if (mm < num + r)
            ll = mm + 1;
          else
            rr = mm - 1;
        }
      }
    }
    if (l == n + 1)
      continue;
    else {
      int pos = (int)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;
}
