#include <bits/stdc++.h>
using namespace std;
struct Node {
  char s[110];
  int x[30];
} a[2010];
int len, k, n;
int main() {
  scanf("%d", &k);
  scanf("%s", a[1].s);
  len = strlen(a[1].s);
  memset(a[1].x, 0, sizeof(a[1].x));
  for (int i = 0; i < len; i++) a[1].x[a[1].s[i] - 'a']++;
  for (int i = 2; i <= k; i++) a[i] = a[i - 1];
  scanf("%d", &n);
  while (n--) {
    int p;
    char c;
    scanf("%d %c", &p, &c);
    int i = 1;
    while (p - a[i].x[c - 'a'] > 0) {
      p -= a[i].x[c - 'a'];
      i++;
    }
    for (int j = 0; j < len; j++)
      if (a[i].s[j] == c) {
        p--;
        if (p == 0) {
          a[i].s[j] = '!';
          a[i].x[c - 'a']--;
          break;
        }
      }
  }
  for (int i = 1; i <= k; i++)
    for (int j = 0; j < len; j++)
      if (a[i].s[j] != '!') printf("%c", a[i].s[j]);
  puts("");
  return 0;
}
