#include <bits/stdc++.h>
int k, n;
char str[110];
int cnt[256];
int top[256];
int rec[256][21000];
int cur[256];
int len;
int main(void) {
  int i, j;
  char c;
  int p, pos;
  char tmp[5];
  memset(top, 0, sizeof(top));
  memset(cnt, 0, sizeof(cnt));
  memset(cur, 0, sizeof(cur));
  scanf("%d%s%d", &k, str, &n);
  len = strlen(str);
  for (i = 0; i < n; i++) {
    scanf("%d%s", &p, tmp);
    c = tmp[0];
    pos = top[c];
    for (j = 0; j < top[c]; j++) {
      if (rec[c][j] <= p) {
        p++;
      } else {
        pos = j;
        break;
      }
    }
    for (j = top[c]; j > pos; j--) {
      rec[c][j] = rec[c][j - 1];
    }
    top[c]++;
    rec[c][pos] = p;
  }
  for (i = 0; i < k; i++) {
    for (j = 0; j < len; j++) {
      c = str[j];
      cnt[c]++;
      if (cur[c] < top[c] && cnt[c] == rec[c][cur[c]]) {
        cur[c]++;
      } else {
        putchar(c);
      }
    }
  }
  putchar('\n');
  return 0;
}
