#include <bits/stdc++.h>
using namespace std;
int freq[26] = {0};
vector<vector<int>> ind(26);
bool u[200005];
int main() {
  int k;
  cin >> k;
  int mat[26][k];
  memset(u, true, sizeof(u));
  string s;
  cin >> s;
  int i = 0;
  for (auto a : s) {
    freq[a - 'a']++;
    ind[a - 'a'].push_back(i);
    i++;
  }
  for (int i = 0; i < 26; i++)
    for (int j = 0; j < k; j++) mat[i][j] = freq[i];
  int n;
  cin >> n;
  while (n--) {
    int a;
    char c;
    cin >> a >> c;
    int count = 0, j;
    for (j = 0; j < k; j++) {
      if (count < a)
        count += mat[c - 'a'][j];
      else
        break;
    }
    count -= mat[c - 'a'][j - 1];
    for (int i = 0; i < ind[c - 'a'].size(); i++) {
      if (u[(j - 1) * s.size() + ind[c - 'a'][i]]) {
        count++;
        if (count == a) {
          u[(j - 1) * s.size() + ind[c - 'a'][i]] = false;
          mat[c - 'a'][j - 1]--;
          break;
        }
      }
    }
  }
  string print;
  for (int i = 0; i < k * s.size(); i++) {
    if (u[i]) print += s[i % s.size()];
  }
  cout << print << endl;
  return 0;
}
