#include <bits/stdc++.h>
using namespace std;
int main() {
  int k;
  cin >> k;
  string second;
  cin >> second;
  vector<vector<int> > v(26);
  int pos = 0;
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < second.size(); ++j) {
      v[second[j] - 'a'].push_back(pos++);
    }
  }
  int n;
  cin >> n;
  while (n--) {
    int p;
    char c;
    scanf("%d %c", &p, &c);
    v[c - 'a'].erase(v[c - 'a'].begin() + p - 1);
  }
  vector<pair<int, char> > ans;
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 0; j < v[i].size(); ++j) {
      ans.push_back(make_pair(v[i][j], i + 'a'));
    }
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); ++i) cout << ans[i].second;
  return 0;
}
