#include <bits/stdc++.h>
using namespace std;
void subsetsUtil(long long *c, vector<vector<long long> > &res,
                 vector<long long> &subset, int index, int n) {
  res.push_back(subset);
  for (int i = index; i < n; i++) {
    subset.push_back(c[i]);
    subsetsUtil(c, res, subset, i + 1, n);
    subset.pop_back();
  }
  return;
}
vector<vector<long long> > subsets(long long *c, int n) {
  vector<long long> subset;
  vector<vector<long long> > res;
  int index = 0;
  subsetsUtil(c, res, subset, index, n);
  return res;
}
int main() {
  int w;
  w = 1;
  while (w--) {
    int k, n;
    string s, ans;
    cin >> k >> s;
    char a[k + 1][s.size() + 1];
    int b[k + 1][26];
    memset(b, 0, sizeof(b));
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < s.size(); j++) {
        a[i][j] = s[j];
        b[i][(int)(s[j] - 'a')]++;
      }
    }
    cin >> n;
    for (int i = 0; i < n; i++) {
      int p;
      char c;
      cin >> p >> c;
      for (int j = 0; j < k; j++) {
        if (b[j][(int)(c - 'a')] >= p) {
          for (int d = 0; d < s.size(); d++) {
            if (a[j][d] == c) {
              p--;
              if (p == 0) a[j][d] = '0';
            }
          }
          b[j][(int)(c - 'a')]--;
          break;
        } else
          p -= b[j][(int)(c - 'a')];
      }
    }
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < s.size(); j++) {
        if (a[i][j] != '0') ans.push_back(a[i][j]);
      }
    }
    cout << ans << endl;
  }
}
