#include <bits/stdc++.h>
using namespace std;
int dir[400040], esq[400040];
int soma[400040][26];
int pilha[400040];
int cont;
int tam;
char buf[500];
char str[200020], resp[200020];
int build(int no, int x, int y) {
  if (x == y) {
    for (int i = 0; i < 26; ++i) soma[no][i] = 0;
    ++soma[no][str[x - 1] - 'a'];
  } else {
    int meio = (x + y) / 2;
    esq[no] = build(cont++, x, meio);
    dir[no] = build(cont++, meio + 1, y);
    for (int i = 0; i < 26; ++i)
      soma[no][i] = soma[esq[no]][i] + soma[dir[no]][i];
  }
  return no;
}
void query(int letra, int qtd) {
  int no = 0, x = 1, y = tam;
  while (x != y) {
    int meio = (x + y) / 2;
    --soma[no][letra];
    if (qtd <= soma[esq[no]][letra]) {
      no = esq[no];
      y = meio;
    } else {
      qtd -= soma[esq[no]][letra];
      no = dir[no];
      x = meio + 1;
    }
  }
  --soma[no][letra];
  str[x - 1] = 0;
}
int main() {
  int k;
  scanf("%d %s", &k, buf);
  tam = 0;
  for (int i = 0; i < k; ++i) {
    for (int j = 0; buf[j]; ++j) str[tam++] = buf[j];
  }
  str[tam] = 0;
  cont = 1;
  build(0, 1, tam);
  int q;
  scanf("%d", &q);
  while (q--) {
    int p;
    scanf("%d %s", &p, buf);
    query(buf[0] - 'a', p);
  }
  int prt = 0;
  for (int i = 0; i < tam; ++i) {
    if (str[i]) resp[prt++] = str[i];
  }
  resp[prt] = 0;
  printf("%s\n", resp);
}
