#include <bits/stdc++.h>
using namespace std;
vector<int> v[1000];
vector<int>::iterator it;
int main() {
  int t, i, op, pos, k, s, j;
  char ch;
  string str, S;
  cin >> t;
  cin >> str;
  for (i = 1; i <= t; i++) S += str;
  s = S.size();
  for (i = 0; i < s; i++) v[S[i] - 'a'].push_back(i);
  cin >> op;
  while (op--) {
    cin >> pos >> ch;
    k = v[ch - 'a'][pos - 1];
    it = v[ch - 'a'].begin();
    v[ch - 'a'].erase(it + pos - 1);
    S[k] = 'X';
  }
  for (i = 0; i < s; i++)
    if (S[i] != 'X') cout << S[i];
  cout << endl;
  return 0;
}
