#include <bits/stdc++.h>
using namespace std;
string bucket[2024];
int freq[2024][26];
int ori[26];
int main() {
  int k, n;
  string s;
  cin >> k >> s >> n;
  for (int i = 0; i < (int)s.length(); i++) ori[s[i] - 'a']++;
  for (int i = 0; i < k; i++) {
    bucket[i] = s;
    for (int j = 0; j < 26; j++) freq[i][j] = ori[j];
  }
  int t;
  char c;
  for (int x = 0; x < n; x++) {
    cin >> t >> c;
    int let = c - 'a';
    for (int i = 0; i < k; i++) {
      if (freq[i][let] >= t) {
        int ct = 0;
        for (int j = 0; j < (int)bucket[i].length(); j++) {
          if (bucket[i][j] == c) ct++;
          if (ct == t) {
            bucket[i][j] = '\0';
            break;
          }
        }
        freq[i][let]--;
        break;
      } else
        t -= freq[i][let];
    }
  }
  string ans = "";
  for (int i = 0; i < k; i++)
    for (int j = 0; j < (int)bucket[i].length(); j++)
      if (bucket[i][j] != '\0') ans += bucket[i][j];
  cout << ans << endl;
}
