#include <bits/stdc++.h>
using namespace std;
int maxIndice = (200009);
int arv[(200009) + 1][32];
int mrc[(200009)];
int acumula(int indice, int letra) {
  int soma = 0;
  while (indice) {
    soma += arv[indice][letra];
    indice -= (indice & -indice);
  }
  return soma;
}
void update(int indice, int valor, int letra) {
  while (indice <= maxIndice) {
    arv[indice][letra] += valor;
    indice += (indice & -indice);
  }
}
int main(void) {
  memset(arv, 0, sizeof(arv));
  memset(mrc, 0, sizeof(mrc));
  int n;
  string pal, word;
  scanf("%d", &n);
  cin >> pal;
  for (int i = 0; i < n; i++) word += pal;
  int sz = word.size();
  for (int i = 0; i < sz; i++) update(i + 1, 1, word[i] - 'a');
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int id;
    char let;
    scanf("%d %c", &id, &let);
    int lo = 1, hi = sz;
    int pos;
    while (lo <= hi) {
      int mid = lo + (hi - lo) / 2;
      int total = acumula(mid, let - 'a');
      if (total < id)
        lo = mid + 1;
      else if (total >= id) {
        if (total == id) pos = mid;
        hi = mid - 1;
      }
    }
    mrc[pos] = 1;
    update(pos, -1, let - 'a');
  }
  for (int i = 0; i < sz; i++) {
    if (mrc[i + 1] == 0) printf("%c", word[i]);
  }
  printf("\n");
  return 0;
}
