#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 200010;
char s[maxn] = {};
int cnt[500][30] = {};
bool del[maxn] = {};
int main() {
  int k;
  scanf("%d", &k);
  scanf("%s", &s);
  int n = strlen(s);
  for (int i = n; i < k * n; ++i) s[i] = s[i - n];
  s[k * n] = 0;
  n = k * n;
  int block = 1 + sqrt(n + .0);
  for (int i = 0; i < n; ++i) cnt[i / block][s[i] - 'a']++;
  int q;
  scanf("%d", &q);
  while (q--) {
    int pos;
    scanf("%d", &pos);
    pos--;
    char c = 0;
    while (!(c >= 'a' && c <= 'z')) c = getchar();
    c -= 'a';
    int curb = 0;
    while (pos >= cnt[curb][c]) pos -= cnt[curb][c], curb++;
    int j = curb * block;
    while (true) {
      if (s[j] == c + 'a' && !del[j]) --pos;
      if (pos < 0) {
        del[j] = 1;
        cnt[curb][c]--;
        break;
      }
      j++;
    }
  }
  for (int i = 0; i < n; ++i)
    if (!del[i]) putchar(s[i]);
  return 0;
}
