#include <bits/stdc++.h>
using namespace std;
string convertInt(int number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
int main() {
  int r;
  cin >> r;
  string s, S;
  cin >> s;
  for (int i = 0; i < r; i++) S += s;
  vector<int> C[27];
  bool marked[200009] = {false};
  for (int i = 0; i < S.length(); i++) C[S[i] - 'a'].push_back(i);
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    int _th;
    char c;
    cin >> _th >> c;
    marked[C[c - 'a'].at(_th - 1)] = true;
    C[c - 'a'].erase(C[c - 'a'].begin() + _th - 1);
  }
  for (int i = 0; i < S.length(); i++) {
    if (!marked[i]) cout << S[i];
  }
  return 0;
}
