#include <bits/stdc++.h>
using namespace std;
int k, n;
string s;
int main() {
  cin >> k;
  cin >> s;
  string nik[2000];
  for (int i = 0; i < k; i++) nik[i] = s;
  int abc[2000][26];
  for (int i = 0; i < 26; i++) {
    abc[0][i] = 0;
  }
  for (int i = 0; i < s.size(); i++) {
    abc[0][int(s[i] - 'a')] += 1;
  }
  for (int i = 1; i < k; i++) {
    for (int j = 0; j < 26; j++) abc[i][j] = abc[0][j];
  }
  cin >> n;
  int ind = 0;
  char c = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> ind;
    cin >> c;
    count = 0;
    int j = 0;
    c = c - 'a';
    while (count < ind) {
      count += abc[j][c];
      j++;
    }
    j--;
    count -= abc[j][c];
    int nomber_of_letter = ind - count;
    int k = 0;
    for (; nomber_of_letter != 0; k++) {
      if (nik[j][k] == (c + 'a')) nomber_of_letter--;
    }
    k--;
    nik[j].erase(k, 1);
    abc[j][c] -= 1;
  }
  for (int i = 0; i < k; i++) cout << nik[i];
  return 0;
}
