#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  char s[200];
  vector<int> __v;
  __v.assign(1000000, 127);
  cin >> s;
  int n;
  cin >> n;
  set<int> n_del['z' - 'a' + 1];
  set<int>::iterator pos_n_del['z' - 'a' + 1];
  for (int i = 0; i < n; i++) {
    char c;
    int nc;
    cin >> nc >> c;
    set<int>::iterator it = n_del[c - 'a'].begin();
    if (n_del[c - 'a'].empty() || nc <= *it) {
      n_del[c - 'a'].insert(nc - 1);
      continue;
    }
    nc -= *it;
    int pos = 0;
    while (it != n_del[c - 'a'].end() && nc > 0) {
      set<int>::iterator it0 = it;
      it++;
      if (it != n_del[c - 'a'].end()) {
        nc -= *it - *it0 - 1;
      }
    }
    if (nc > 0) {
      it--;
      pos = *it + nc;
    } else
      pos = *it + nc - 1;
    n_del[c - 'a'].insert(pos);
  }
  for (int i = 0; i < 'z' - 'a' + 1; ++i) {
    pos_n_del[i] = n_del[i].begin();
  }
  int tSums['z' - 'a' + 1] = {0};
  for (int i = 0, len = strlen(s), j = 0; i < len * k; ++i, ++j) {
    if (j == len) j = 0;
    if (pos_n_del[s[j] - 'a'] != n_del[s[j] - 'a'].end() &&
        *pos_n_del[s[j] - 'a'] == tSums[s[j] - 'a']) {
      pos_n_del[s[j] - 'a']++;
    } else
      cout << s[j];
    tSums[s[j] - 'a']++;
  }
  cout << endl;
  cerr << __v[rand() % __v.size()];
}
