#include <bits/stdc++.h>
using namespace std;
const int maxn = 2010, inf = 1000000000, mod = 1000003;
int arr[maxn][30];
int main() {
  int n, len;
  string s, cs;
  cin >> n >> s;
  cs = s;
  len = s.size();
  for (int i = 0; i < s.size(); i++) arr[0][int(s[i] - 'a')]++;
  for (int i = 1; i < n; i++)
    for (int j = 0; j < 30; j++) arr[i][j] = arr[0][j];
  for (int i = 1; i < n; i++) s += cs;
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int x, w = 0, t = 0, q = 0, k;
    char c;
    cin >> x >> c;
    k = int(c - 'a');
    while (t + arr[q][k] < x) {
      w += len;
      t += arr[q][k];
      q++;
    }
    t += (int(s[w] - 'a' == k) ? 1 : 0);
    while (t < x) {
      w++;
      if (int(s[w] - 'a') == k) t++;
    }
    s[w] = '.';
    arr[q][k]--;
  }
  for (int i = 0; i < s.size(); i++)
    if (s[i] != '.') cout << s[i];
  cout << endl;
  return 0;
}
