#include <bits/stdc++.h>
using namespace std;
int t[26][200005];
void add(int c, int p, int v) {
  for (; p <= 200003; p += p & -p) t[c][p] += v;
}
int que(int c, int p) {
  int z = 0;
  for (; p; p -= p & -p) z += t[c][p];
  return z;
}
int main() {
  ios::sync_with_stdio(false);
  int k, n, p;
  char c;
  bool z[200005] = {};
  string s, ss;
  cin >> k >> ss;
  while (k--) s += ss;
  for (int i = 1; i <= s.length(); i++) add(s[i - 1] - 'a', i, 1);
  cin >> n;
  while (n--) {
    cin >> p >> c;
    int l = 0, r = 200002;
    while (l + 1 < r) {
      int m = (l + r) >> 1;
      if (que(c - 'a', m) < p)
        l = m;
      else
        r = m;
    }
    z[r] = 1;
    add(c - 'a', r, -1);
  }
  for (int i = 1; i <= s.length(); i++)
    if (!z[i]) cout << s[i - 1];
}
