#include <bits/stdc++.h>
using namespace std;
string str = "";
int find_binary_search(int left, int right, char c) {
  if (left >= right) {
    return right;
  }
  int mid = (left + right) / 2;
  if ((str[mid] - 'a') >= (c - 'a')) {
    return find_binary_search(left, mid, c);
  } else {
    return find_binary_search(mid + 1, right, c);
  }
}
bool compareChar(pair<char, int> f, pair<char, int> s) {
  return f.first < s.first;
}
bool compareInt(pair<char, int> f, pair<char, int> s) {
  return f.second < s.second;
}
map<char, vector<int> > alph;
int main() {
  int k;
  cin >> k;
  string s;
  cin >> s;
  for (int i = 0; i < k; i++) {
    str += s;
  }
  for (int i = 0; i < str.size(); i++) {
    alph[str[i]].push_back(i);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p;
    char c;
    cin >> p >> c;
    str[alph[c][p - 1]] = '_';
    alph[c].erase((alph[c].begin()) + (p - 1));
  }
  for (int i = 0; i < str.size(); i++) {
    if (str[i] != '_') cout << str[i];
  }
  return 0;
}
