#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int k;
  cin >> k;
  string str, s;
  cin >> str;
  s = str;
  for (long long int i = 1; i < k; i++) str = str + s;
  map<char, vector<long long int>> pos;
  long long int i = 0;
  for (auto c : str) {
    pos[c].push_back(i);
    i++;
  }
  long long int n;
  cin >> n;
  char c;
  long long int p;
  while (n--) {
    cin >> p >> c;
    str[pos[c][p - 1]] = 0;
    pos[c].erase(pos[c].begin() + (p - 1));
  }
  for (auto c : str)
    if (c) cout << c;
  return 0;
}
