#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool uin(T &a, T b) {
  return a > b && (a = b, true);
}
template <class T>
inline bool uax(T &a, T b) {
  return a < b && (a = b, true);
}
struct FT {
  vector<long long> s;
  FT(int n) : s(n) {}
  void update(int pos, long long dif) {
    for (; pos < (int)s.size(); pos |= pos + 1) s[pos] += dif;
  }
  long long query(int pos) {
    long long res = 0;
    for (; pos > 0; pos &= pos - 1) res += s[pos - 1];
    return res;
  }
  int lower_bound(long long sum) {
    if (sum <= 0) return -1;
    int pos = 0;
    for (int pw = 1 << 25; pw; pw >>= 1) {
      if (pos + pw <= (int)s.size() && s[pos + pw - 1] < sum)
        pos += pw, sum -= s[pos - 1];
    }
    return pos;
  }
};
string all_chars =
    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
class FLettersRemoving {
  int N, M;
  string S;

 public:
  void solve_case(istream &cin, ostream &cout) {
    cin >> N >> M >> S;
    unordered_map<char, int> cid;
    const int ALF = (int)all_chars.length();
    for (int i = 0; i < ALF; ++i) {
      cid[all_chars[i]] = i;
    }
    vector<vector<bool>> can_print(ALF);
    vector<vector<int>> pos(ALF);
    for (int i = 0; i < N; ++i) {
      can_print[cid[S[i]]].push_back(true);
      pos[cid[S[i]]].push_back(i);
    }
    FT ft(N);
    for (int i = 0; i < N; ++i) ft.update(i, 1);
    for (int i = 0; i < M; ++i) {
      int l, r;
      char c;
      cin >> l >> r >> c;
      l = ft.lower_bound(l);
      r = ft.lower_bound(r);
      int l_idx = lower_bound(pos[cid[c]].begin(), pos[cid[c]].end(), l) -
                  pos[cid[c]].begin();
      int r_idx = upper_bound(pos[cid[c]].begin(), pos[cid[c]].end(), r) -
                  pos[cid[c]].begin();
      for (int j = l_idx; j < r_idx; ++j) {
        if (!can_print[cid[c]][j]) continue;
        ft.update(pos[cid[c]][j], -1);
        can_print[cid[c]][j] = false;
      }
    }
    vector<bool> sol_print(N, true);
    for (int i = 0; i < ALF; ++i) {
      for (int j = 0; j < (int)pos[i].size(); ++j) {
        sol_print[pos[i][j]] = can_print[i][j];
      }
    }
    for (int i = 0; i < N; ++i)
      if (sol_print[i]) cout << S[i];
    cout << '\n';
  }
  void solve(istream &cin, ostream &cout) {
    int tt = 1;
    while (tt--) solve_case(cin, cout);
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  FLettersRemoving solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}
