#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
int cnt[2010][26];
string str[2010];
int main() {
  ios::sync_with_stdio(false);
  int k;
  string s;
  cin >> k >> s;
  for (__typeof(s.begin()) _ind = (s).begin(); _ind != (s).end(); _ind++)
    for (bool _flag = true; _flag;)
      for (__typeof(*(s).begin()) &c = *_ind; _flag; _flag = false)
        for (int i = 0, __e = k; i < __e; i++) cnt[i][c - 'a']++;
  for (int i = 0, __e = k; i < __e; i++) str[i] = s;
  int n;
  cin >> n;
  for (int __i = n; __i > 0; __i--) {
    int o;
    char c;
    cin >> o >> c;
    int i = 0;
    while (i < k && cnt[i][c - 'a'] < o) o -= cnt[i][c - 'a'], i++;
    int z = 0;
    for (int j = 0, __e = ((int)(str[i]).size()); j < __e; j++) {
      if (str[i][j] == c) z++;
      if (z == o) {
        str[i].erase(str[i].begin() + j);
        break;
      }
    }
    cnt[i][c - 'a']--;
  }
  for (int i = 0, __e = k; i < __e; i++) cout << str[i];
  cout << '\n';
  return 0;
}
