#include <bits/stdc++.h>
using namespace std;
const int maxs = 200010;
int t;
char ch[maxs], ch1[110];
vector<int> pos[26];
int main() {
  scanf("%d %s", &t, ch1);
  ch[0] = '\0';
  for (int i = 1; i <= t; i++) strcat(ch, ch1);
  int len = strlen(ch);
  for (int i = 0; i < len; i++) pos[ch[i] - 'a'].push_back(i);
  int k;
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    scanf("%d %s", &t, ch1);
    pos[ch1[0] - 'a'].erase(pos[ch1[0] - 'a'].begin() + t - 1);
  }
  vector<pair<int, char> > v;
  for (int i = 0; i < 26; i++) {
    int ts = pos[i].size();
    for (int j = 0; j < ts; j++) {
      v.push_back(make_pair(pos[i][j], i + 'a'));
    }
  }
  sort(v.begin(), v.end());
  int tsize = v.size();
  for (int i = 0; i < tsize; i++) putchar(v[i].second);
  cout << endl;
  return 0;
}
