#include <bits/stdc++.h>
char buf[200005], c[2];
int i, j, k, l, m, n, tree[26][200005];
void add(int a, int x, int amt) {
  for (; x < 200005; x += x & (-x)) tree[a][x] += amt;
}
int freq(int a, int x) {
  int ans = tree[a][x], end = x - (x & (-x));
  for (x--; x > end; x -= x & (-x)) ans -= tree[a][x];
  return ans;
}
int find(int a, int cf) {
  int ans = 0, del = 1;
  for (ans = l >> 1; ans; ans >>= 1) del <<= 1;
  for (ans = 0; del; del >>= 1)
    if (ans + del <= l && tree[a][ans + del] < cf) {
      ans += del;
      cf -= tree[a][ans];
    }
  return ans;
}
int main() {
  scanf("%d%s%d", &k, buf, &n);
  while (buf[++m])
    ;
  l = k * m;
  for (i = m; i < l; i++) buf[i] = buf[i - m];
  for (i = 0; i < l; i++) add(buf[i] - 'a', i + 1, 1);
  for (i = 0; i < n; i++) {
    scanf("%d%s", &j, c);
    k = find(c[0] - 'a', j);
    add(c[0] - 'a', k + 1, -1);
  }
  l -= n;
  for (i = j = 0; i < l; i++, j++) {
    while (!freq(buf[j] - 'a', j + 1)) j++;
    buf[i] = buf[j];
  }
  buf[l] = 0;
  printf("%s\n", buf);
  return 0;
}
