#include <bits/stdc++.h>
using namespace std;
vector<int> a[26];
int main() {
  int k;
  scanf("%d", &k);
  getchar();
  char s[105];
  gets(s);
  int n = (int)strlen(s), i, j;
  for (j = 0; j < k; ++j) {
    for (i = 0; i < n; ++i) {
      int b = s[i] - 'a';
      a[b].push_back(j * n + i);
    }
  }
  int m, p;
  scanf("%d", &m);
  char c;
  for (i = 0; i < m; ++i) {
    scanf("%d %c", &p, &c);
    int b = c - 'a';
    a[b].erase(a[b].begin() + p - 1);
  }
  priority_queue<pair<int, pair<int, int> >,
                 vector<pair<int, pair<int, int> > >,
                 greater<vector<pair<int, pair<int, int> > >::value_type> >
      pq;
  for (i = 0; i < 26; ++i) {
    if (a[i].size() > 0)
      pq.push(pair<int, pair<int, int> >(a[i][0], pair<int, int>(i, 0)));
  }
  while (!pq.empty()) {
    pair<int, pair<int, int> > t = pq.top();
    pq.pop();
    int c = t.second.first, idx = t.second.second;
    printf("%c", c + 'a');
    if (idx + 1 < a[c].size())
      pq.push(pair<int, pair<int, int> >(a[c][idx + 1],
                                         pair<int, int>(c, idx + 1)));
  }
  printf("\n");
  return 0;
}
