#include <bits/stdc++.h>
using namespace std;
void zuka() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
string maker(string x, int times) {
  string r = "";
  for (int i = 1; i <= times; i++) {
    r += x;
  }
  return r;
}
int main() {
  zuka();
  int n;
  string x;
  cin >> n >> x;
  string word = maker(x, n);
  map<pair<char, int>, int> m;
  vector<int> freq[26];
  for (int i = 0; i < word.length(); i++) {
    freq[word[i] - 'a'].push_back(i);
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    char a;
    int occur;
    cin >> occur >> a;
    word[freq[a - 'a'][occur - 1]] = '?';
    freq[a - 'a'].erase(freq[a - 'a'].begin() + occur - 1);
  }
  for (int i = 0; i < word.length(); i++) {
    if (word[i] != '?') cout << word[i];
  }
}
