#include <bits/stdc++.h>
using namespace std;
set<int> cset[200];
vector<pair<int, char> > fs;
int tree[524298], n, m;
void update(int i, int l, int r, int x) {
  int m = (l + r) >> 1;
  if (l == r) {
    tree[i]++;
    return;
  } else if (x <= m) {
    update(2 * i, l, m, x);
  } else {
    update(2 * i + 1, m + 1, r, x);
  }
  tree[i] = tree[2 * i] + tree[2 * i + 1];
}
int query(int i, int l, int r, int tl, int tr) {
  if (l > r) {
    return 0;
  } else if (l == tl && r == tr) {
    return tree[i];
  } else {
    int tm = (tl + tr) >> 1, ql, qr;
    ql = query(2 * i, l, min(tm, r), tl, tm);
    qr = query(2 * i + 1, max(tm + 1, l), r, tm + 1, tr);
    return ql + qr;
  }
}
int remap(int x) {
  int start = x, end = n, mid, rmid;
  while (start < end) {
    mid = (start + end + 1) / 2;
    rmid = mid - query(1, 1, mid - 1, 1, n);
    if (rmid <= x) {
      start = mid;
    } else {
      end = mid - 1;
    }
  }
  return start;
}
void remove(int l, int r, char c) {
  set<int>::iterator lit = cset[c].upper_bound(l - 1),
                     rit = cset[c].upper_bound(r), it;
  it = lit;
  while (it != rit) {
    update(1, 1, n, *it);
    it++;
  }
  cset[c].erase(lit, rit);
}
int main() {
  cin >> n >> m;
  string s;
  cin >> s;
  int l, r;
  char c;
  for (int i = 0; i < 524298; i++) {
    tree[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cset[s[i]].insert(i + 1);
  }
  for (int i = 0; i < m; i++) {
    cin >> l >> r >> c;
    l = remap(l);
    r = remap(r);
    remove(l, r, c);
  }
  for (int i = 0; i < 200; i++) {
    for (int j : cset[i]) {
      fs.push_back(pair<int, char>(j, char(i)));
    }
  }
  sort(fs.begin(), fs.end());
  for (pair<int, char> p : fs) {
    cout << p.second;
  }
  cout << endl;
  return 0;
}
