#include <bits/stdc++.h>
using namespace std;
string s[3000];
int a[3000][100];
int main() {
  int t;
  cin >> t;
  cin >> s[0];
  for (int j = 0; j < s[0].length(); j++) a[0][s[0][j] - 'a']++;
  for (int i = 1; i < t; i++) {
    s[i] = s[0];
    for (int j = 0; j < 26; j++) a[i][j] = a[0][j];
  }
  int n;
  cin >> n;
  int p, j, k;
  char c;
  for (int i = 0; i < n; i++) {
    cin >> p >> c;
    j = 0;
    while (p - a[j][c - 'a'] > 0) {
      p -= a[j][c - 'a'];
      j++;
    }
    a[j][c - 'a']--;
    for (k = 0; k < s[j].length(); k++)
      if (s[j][k] == c) {
        p--;
        if (p == 0) break;
      }
    s[j].erase(k, 1);
  }
  for (int i = 0; i < t; i++) cout << s[i];
}
