#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2 * 1e5 + 10;
class Node {
 public:
  int counts[62];
  bool lazy[62];
  Node() {
    for (int i = 0; i < 62; ++i) {
      counts[i] = 0;
      lazy[i] = false;
    }
  }
};
Node tree[MAXN << 2];
char s[MAXN];
bool lazy[62];
int n, m;
int char2Index(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  } else if (c >= 'a' && c <= 'z') {
    return c - 'a' + 10;
  } else {
    return c - 'A' + 36;
  }
}
void insert(int now, int pos, char c, int l, int r) {
  if (pos >= l && pos <= r) {
    int i = char2Index(c);
    tree[now].counts[i]++;
  }
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (pos <= mid)
    insert(now << 1, pos, c, l, mid);
  else
    insert((now << 1) | 1, pos, c, mid + 1, r);
  return;
}
void Delete(int now, int tl, int tr, int l, int r, char c) {
  int i = char2Index(c);
  if (tl == l && tr == r) {
    tree[now].counts[i] = 0;
    tree[now].lazy[i] = true;
    return;
  }
  int mid = (tl + tr) >> 1;
  if (l >= mid + 1) {
    Delete((now << 1) | 1, mid + 1, tr, l, r, c);
  } else if (r <= mid) {
    Delete((now << 1), tl, mid, l, r, c);
  } else {
    Delete((now << 1), tl, mid, l, mid, c);
    Delete((now << 1) | 1, mid + 1, tr, mid + 1, r, c);
  }
  tree[now].counts[i] =
      min(tree[now].counts[i],
          tree[now << 1].counts[i] + tree[(now << 1) | 1].counts[i]);
  return;
}
int oriIndex(int dex) {
  for (int i = 0; i < 62; ++i) lazy[i] = false;
  int now = 1;
  int cap = n;
  int cts = 0;
  int ans = 0;
  int l = 1;
  int r = n;
  while (l != r) {
    int mid = (l + r) >> 1;
    for (int i = 0; i < 62; ++i) lazy[i] |= tree[now].lazy[i];
    int left_total = 0;
    for (int i = 0; i < 62; ++i) {
      if (!lazy[i]) left_total += tree[now << 1].counts[i];
    }
    if (cts + left_total < dex) {
      ans += (cap + 1) >> 1;
      cts += left_total;
      cap = cap >> 1;
      now = (now << 1) | 1;
      l = mid + 1;
    } else {
      cap = (cap + 1) >> 1;
      now = (now << 1);
      r = mid;
    }
  }
  ans += cap;
  return ans;
}
bool query(int pos) {
  int now = 1;
  int tl = 1;
  int tr = n;
  int i = char2Index(s[pos - 1]);
  while (tl != tr) {
    if (tree[now].counts[i] == 0) {
      return false;
    }
    int mid = (tl + tr) >> 1;
    if (pos <= mid) {
      now = now << 1;
      tr = mid;
    } else {
      now = (now << 1) | 1;
      tl = mid + 1;
    }
  }
  if (tree[now].counts[i] == 0) {
    return false;
  }
  return tree[now].counts[i] != 0;
}
int l, r;
char c;
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%s", s);
  for (int i = 0; i < (MAXN << 1); ++i) {
    for (int j = 0; j < 62; ++j) tree[i].counts[j] = 0;
  }
  int s_len = strlen(s);
  for (int i = 0; i < s_len; ++i) insert(1, i + 1, s[i], 1, n);
  for (int j = 0; j < m; ++j) {
    cin >> l >> r;
    cin >> c;
    int ol = oriIndex(l);
    int _or = oriIndex(r);
    Delete(1, 1, n, ol, _or, c);
  }
  for (int i = 1; i <= s_len; ++i) {
    if (query(i)) cout << s[i - 1];
  }
  return 0;
}
