#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  int k, n;
  string s, ss;
  vector<int> v(int('z' - 'a') + 1);
  cin >> k >> s >> n;
  for (int i = 0; i < int((s).size()); ++i) ++v[s[i] - 'a'];
  vector<vector<int> > w(int('z' - 'a') + 1);
  for (int i = 0; i < int((w).size()); ++i) w[i].resize(k, v[i]);
  for (int i = 0; i < (k); ++i) ss += s;
  for (int i = 0; i < (n); ++i) {
    int num, j = 0, sum = 0, t, cnt;
    char ch;
    cin >> num >> ch;
    while (sum + w[ch - 'a'][j] < num) {
      sum += w[ch - 'a'][j];
      ++j;
    }
    --w[ch - 'a'][j];
    for (t = j * s.size(), cnt = 0; cnt < num - sum; ++t)
      if (ss[t] == ch) ++cnt;
    ss[t - 1] = '?';
  }
  for (int i = 0; i < int((ss).size()); ++i)
    if (ss[i] != '?') cout << ss[i];
  cout << endl;
  return 0;
}
