#include <bits/stdc++.h>
char s[1000000];
int have[2100][200];
int k, l, kl, m;
int a;
int find(int c) {
  for (int i = 1; i <= k; i++) {
    if (have[i][c] >= a) return i;
    a -= have[i][c];
  }
}
void change(int d, int a, char c) {
  have[d][c - 'a']--;
  for (int i = (d - 1) * l; i < d * l; i++) {
    if (s[i] == c) a--;
    if (a == 0) {
      s[i] = '*';
      return;
    }
  }
}
int main() {
  scanf("%d %s", &k, s);
  l = strlen(s);
  for (int i = 0; i < l; i++)
    for (int j = 1; j <= k; j++) have[j][s[i] - 'a']++;
  kl = k * l;
  for (int i = l; i < kl; i++) s[i] = s[i % l];
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    char c[10];
    scanf("%d %s", &a, c);
    int d = find(c[0] - 'a');
    change(d, a, c[0]);
  }
  for (int i = 0; i < kl; i++) {
    if (s[i] != '*') printf("%c", s[i]);
  }
  printf("\n");
}
