#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, n, p;
  char c;
  scanf("%d%d", &k);
  string s;
  cin >> s;
  vector<string> v(k, s);
  vector<vector<int>> counts(k);
  for (int i = 0; i < k; i++) counts[i].assign(26, 0);
  for (int i = 0; i < s.length(); i++) {
    int it = s[i] - 'a';
    counts[0][it]++;
  }
  for (int i = 1; i < k; i++) {
    for (int j = 0; j < 26; j++) counts[i][j] = counts[i - 1][j] + counts[0][j];
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> p >> c;
    int it = c - 'a';
    bool flag = 0;
    for (int j = 0; j < k; j++) {
      if (counts[j][it] >= p) {
        if (j == 0) {
          int tmp = p;
          int ok = 0;
          for (int z = 0; z < v[j].length(); z++) {
            if (v[j][z] == c) ok++;
            if (ok == tmp) {
              tmp = z;
              break;
            }
          }
          string s1 = v[j].substr(0, tmp);
          string s2 = v[j].substr(tmp + 1, v[j].length());
          v[j] = s1 + s2;
          flag = 1;
        }
        if (!flag) {
          int tmp = p - counts[j - 1][it];
          int ok = 0;
          for (int z = 0; z < v[j].length(); z++) {
            if (v[j][z] == c) ok++;
            if (ok == tmp) {
              tmp = z;
              break;
            }
          }
          string s1 = v[j].substr(0, tmp);
          string s2 = v[j].substr(tmp + 1, v[j].length());
          v[j] = s1 + s2;
          flag = 1;
        }
        counts[j][it]--;
      }
    }
  }
  for (int i = 0; i < k; i++) cout << v[i];
  return 0;
}
