#include <bits/stdc++.h>
using namespace std;
int countbit(int n) { return (n == 0) ? 0 : (1 + countbit(n & (n - 1))); }
int lowbit(int n) { return (n ^ (n - 1)) & n; }
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
T sqr(T x) {
  return x * x;
}
bool DBG;
struct dbg {
  template <typename T>
  dbg& operator,(const T& v) {
    if (DBG) cerr << v << " ";
    return *this;
  }
  ~dbg() {
    if (DBG) cerr << endl;
  }
};
int freq[26];
int main(int argc, char* argv[]) {
  if (argc > 1) DBG = ((*argv[1] == '0') ? 0 : 1);
  int k, n;
  string s;
  cin >> k >> s >> n;
  int freq[k][26];
  memset(freq, 0, sizeof(freq));
  for (int i = 0; i < ((int)((s).length())); ++i)
    for (int j = 0; j < k; ++j) freq[j][s[i] - 'a']++;
  bool copy[k][((int)((s).length()))];
  memset(copy, true, sizeof(copy));
  for (int i = 0; i < n; ++i) {
    int p;
    char c;
    cin >> p >> c;
    int j, row, col;
    for (j = 0; j < k && p > freq[j][c - 'a']; j++) p -= freq[j][c - 'a'];
    row = j;
    int count = 0;
    for (j = 0; j < ((int)((s).length())) && count < p; j++)
      if (s[j] == c && copy[row][j]) count++;
    col = j - 1;
    freq[row][c - 'a']--;
    copy[row][col] = false;
  }
  for (int i = 0; i < k; ++i)
    for (int j = 0; j < ((int)((s).length())); ++j)
      if (copy[i][j]) cout << s[j];
  cout << endl;
  return 0;
}
