#include <bits/stdc++.h>
using namespace std;
string IntToStr(int i) {
  stringstream ss;
  ss << i;
  return ss.str();
}
int main() {
  int n, k;
  string s, tempS;
  map<char, vector<int> > Position;
  cin >> k;
  cin >> s;
  tempS = s;
  for (int i = 0; i < k - 1; i++) s += tempS;
  cin >> n;
  for (int i = 0; i < s.length(); i++) {
    Position[s[i]].push_back(i);
  }
  for (int i = 0; i < n; i++) {
    int a;
    char s2;
    cin >> a >> s2;
    s[Position[s2][a - 1]] = '~';
    Position[s2].erase(Position[s2].begin() + (a - 1));
  }
  for (int i = 0; i < s.length(); i++)
    if (s[i] != '~') cout << s[i];
  cout << endl;
  return 0;
}
