#include <bits/stdc++.h>
using namespace std;
const int nMax = 2005;
const int chars = 260;
int letter[nMax][chars];
string word[nMax];
void fillin(int, string);
void ubrat(int, char);
void printing(int);
int main() {
  int k, n, i, p;
  string s;
  char c;
  cin >> k >> s >> n;
  fillin(k, s);
  for (i = 0; i < n; i++) {
    cin >> p >> c;
    ubrat(p, c);
  }
  printing(k);
  return 0;
}
void fillin(int k, string s) {
  int i, j;
  int mas[260] = {0};
  for (i = 0; i < k; i++) word[i] = s;
  for (i = 0; i < (int)s.size(); i++) mas[s[i]]++;
  for (i = 0; i < k; i++)
    for (j = 'a'; j <= 'z'; j++) letter[i][j] = mas[j];
  return;
}
void ubrat(int p, char c) {
  int s0, s = 0, i = -1, j;
  while (s < p) {
    s += letter[++i][c];
  }
  s0 = s - letter[i][c];
  j = i;
  for (i = 0; i < word[j].size(); i++) {
    if (word[j][i] == c) {
      s0++;
      if (s0 == p) {
        letter[j][c]--;
        word[j].erase(i, 1);
        return;
      }
    }
  }
}
void printing(int k) {
  for (int i = 0; i < k; i++) cout << word[i];
  cout << endl;
}
