#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
int n, m, _x, _y, M;
char s[200005];
struct info {
  int s, size, a[63];
  bool tag[63];
  info operator+(const info &o) {
    info f;
    f.s = s + o.s;
    memset(f.tag, 0, sizeof(f.tag));
    f.size = size + o.size;
    for (int i = 1; i <= M; i++) f.a[i] = o.a[i] + this->a[i];
    return f;
  }
} T[524300];
void pushdown(int x) {
  if (T[x].size == 1) return;
  for (int i = 1; i <= M; i++)
    if (T[x].tag[i]) {
      T[x << 1].tag[i] = T[x << 1 | 1].tag[i] = 1;
      T[x << 1].s -= T[x << 1].a[i];
      T[x << 1 | 1].s -= T[x << 1 | 1].a[i];
      T[x << 1].a[i] = 0;
      T[x << 1 | 1].a[i] = 0;
      T[x].tag[i] = 0;
    }
}
int tran(char c) {
  if (isdigit(c)) return c - '0' + 1;
  if ('a' <= c && c <= 'z') return c - 'a' + 10 + 1;
  return c - 'A' + 1 + 10 + 26;
}
void build(int i, int x, int y) {
  int t = x + y >> 1;
  if (x == y) {
    T[i].s = 1;
    T[i].size = 1;
    T[i].a[tran(s[x - 1])] = 1;
    return;
  }
  build(i << 1, x, t);
  build(i << 1 | 1, t + 1, y);
  T[i] = T[i << 1] + T[i << 1 | 1];
}
void mod(int i, int x, int y) {
  int t = x + y >> 1;
  if (_y < x || y < _x) return;
  if (_x <= x && y <= _y) {
    T[i].s -= T[i].a[tran(s[0])];
    T[i].tag[tran(s[0])] = 1;
    T[i].a[tran(s[0])] = 0;
    return;
  }
  pushdown(i);
  mod(i << 1, x, t);
  mod(i << 1 | 1, t + 1, y);
  T[i] = T[i << 1] + T[i << 1 | 1];
}
int find(int i, int x, int y) {
  int t = x + y >> 1;
  pushdown(i);
  if (x == y) return x;
  if (_x <= T[i << 1].s) return find(i << 1, x, t);
  _x -= T[i << 1].s;
  return find(i << 1 | 1, t + 1, y);
}
void out(int i, int x, int y) {
  int t = x + y >> 1;
  pushdown(i);
  if (T[i].s == 0) return;
  if (x == y)
    for (int j = 1; j <= M; j++)
      if (T[i].a[j]) {
        if (j <= 10)
          putchar('0' + j - 1);
        else if (j <= 36)
          putchar('a' + j - 11);
        else
          putchar('A' + j - 37);
        return;
      }
  out(i << 1, x, t);
  out(i << 1 | 1, t + 1, y);
}
int main() {
  M = 26 + 26 + 10;
  n = read();
  m = read();
  scanf("%s", s);
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    _x = read();
    _y = find(1, 1, n);
    _x = read();
    _x = find(1, 1, n);
    swap(_x, _y);
    scanf("%s", s);
    mod(1, 1, n);
  }
  out(1, 1, n);
  putchar('\n');
  return 0;
}
