#include <bits/stdc++.h>
struct char_pos {
  char_pos(uint16_t pos, char c) : pos(pos), c(c) {}
  uint16_t pos;
  char c;
};
inline bool operator>(const char_pos& lhs, const char_pos& rhs) {
  return lhs.pos > rhs.pos;
}
struct segtree {
  uint32_t size;
  std::vector<uint32_t> data;
  segtree(uint32_t size)
      : size(size), data(std::pow(2, std::ceil(std::log2(size)) + 1), 0) {
    this->construct();
  }
  void construct() { this->construct_(1, 1, size); }
  void construct_(uint32_t node, uint32_t begin, uint32_t end) {
    if (begin == end) {
      this->data[node] = 1;
      return;
    }
    const uint32_t mid = (begin + end) / 2;
    construct_(node * 2, begin, mid);
    construct_(node * 2 + 1, mid + 1, end);
    this->data[node] = this->data[node * 2] + this->data[node * 2 + 1];
  }
  void remove_(uint32_t node, uint32_t begin, uint32_t end, uint32_t n) {
    if (begin <= n && end >= n) {
      this->data[node] -= 1;
    }
    if (begin == end) {
      return;
    }
    const uint32_t mid = (begin + end) / 2;
    if (begin <= n && mid >= n) {
      remove_(node * 2, begin, mid, n);
    }
    if (mid + 1 <= n && end >= n) {
      remove_(node * 2 + 1, mid + 1, end, n);
    }
  }
  void remove(uint32_t n) { return this->remove_(1, 1, this->size, n); }
  uint32_t find_(uint32_t node, uint32_t begin, uint32_t end,
                 uint32_t n) const {
    if (begin == end && this->data[node] == 1 && n == 1) {
      return begin;
    }
    const uint32_t mid = (begin + end) / 2;
    const uint32_t l = this->data[node * 2];
    if (l >= n) {
      return this->find_(node * 2, begin, mid, n);
    } else {
      return this->find_(node * 2 + 1, mid + 1, end, n - l);
    }
  }
  uint32_t find(uint32_t n) { return this->find_(1, 1, this->size, n); }
};
int main() {
  size_t n = 0, m = 0;
  std::cin >> n >> m;
  std::string src;
  std::cin >> src;
  std::array<std::set<uint32_t>, 128> data;
  segtree tree(n);
  std::vector<bool> removed(n, true);
  for (size_t i = 0; i < src.size(); i++) {
    data[src[i]].emplace(i + 1);
    removed[i] = false;
  }
  for (size_t i = 0; i < m; i++) {
    size_t l = 0, r = 0;
    char c = '\0';
    std::cin >> l >> r >> c;
    l = tree.find(l);
    r = tree.find(r);
    const auto itl = data[c].lower_bound(l), itr = data[c].upper_bound(r);
    for (auto it = itl; it != itr; it++) {
      tree.remove(*it);
      removed[*it - 1] = true;
    }
    data[c].erase(itl, itr);
  }
  std::string ret;
  for (size_t i = 0; i < n; i++) {
    if (!removed[i]) {
      std::cout << src[i];
    }
  }
  std::cout << '\n';
  return 0;
}
