#include <bits/stdc++.h>
using namespace std;
int cnt[2000 + 1][26];
string m[2000 + 1];
int main() {
  int k;
  cin >> k;
  string s;
  cin >> s;
  for (int i = 0; i < k; ++i) m[i] = s;
  int len = s.length();
  for (int i = 0; i < k; ++i)
    for (int j = 0; j < len; ++j) ++cnt[i][s[j] - 'a'];
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int num;
    cin >> num;
    char smb;
    cin >> smb;
    for (int j = 0; j < k; ++j)
      if (num > cnt[j][smb - 'a'])
        num -= cnt[j][smb - 'a'];
      else {
        --cnt[j][smb - 'a'];
        int q = 0;
        for (int pos = 0; pos < m[j].length(); ++pos)
          if (m[j][pos] == smb) {
            ++q;
            if (q == num) {
              m[j].erase(pos, 1);
              break;
            }
          }
        break;
      }
  }
  for (int i = 0; i < k; ++i) cout << m[i];
  return 0;
}
