#include <bits/stdc++.h>
using namespace std;
int k, n, cnt[2005][27], y, pos;
string s, mark[2005];
char ch;
int main() {
  scanf("%d", &k);
  cin >> s;
  int sz = s.size();
  for (int i = 0; i < sz; i++) {
    y = s[i] - 'a';
    cnt[0][y]++;
  }
  for (int i = 1; i < k + 1; i++) {
    mark[i] = s;
    for (int j = 0; j < 26; j++) cnt[i][j] = cnt[0][j];
  }
  scanf("%d", &n);
  for (int e = 0; e < n; e++) {
    scanf("%d %c", &pos, &ch);
    int c = 1;
    y = ch - 'a';
    while (true) {
      if (pos <= cnt[c][y]) break;
      pos -= cnt[c][y];
      c++;
    }
    cnt[c][y]--;
    int j = -1;
    while (pos > 0) {
      j++;
      if (mark[c][j] == ch) pos--;
    }
    mark[c][j] = '#';
  }
  for (int i = 1; i < k + 1; i++) {
    for (int j = 0; j < sz; j++) {
      if (mark[i][j] != '#') cout << mark[i][j];
    }
  }
  return 0;
}
