#include <bits/stdc++.h>
using namespace std;
int a[300000], ta[26][300000], f[26][300000], ans[26], m, n, k;
bool vv[300000];
string str, st;
int find(int x) { return x & (-x); }
void ins(int ch, int x, int y) {
  while (x <= ans[ch]) {
    ta[ch][x] += y;
    x += find(x);
  }
}
int ask(int ch, int x) {
  int k = 0;
  while (x > 0) {
    k += ta[ch][x];
    x -= find(x);
  }
  return k;
}
void init() {
  cin >> k >> st;
  for (int i = 1; i <= k; i++) str += st;
  a[0] = str.length();
  for (int i = 0; i < a[0]; i++) a[i + 1] = str[i] - 'a';
}
void prepare() {
  for (int i = 1; i <= a[0]; i++) {
    ans[a[i]]++;
    f[a[i]][ans[a[i]]] = i;
  }
  for (int i = 0; i <= 25; i++) {
    ans[i]++;
    for (int j = 1; j <= ans[i]; ++j) ins(i, j, 1);
  }
  scanf("%d", &m);
  int p;
  char ch;
  for (int i = 1; i <= m; i++) {
    scanf("%d %c", &p, &ch);
    ch -= 'a';
    int l = 1, r = ans[ch];
    while (l < r) {
      int mid = l + r >> 1;
      if (ask(ch, mid) < p)
        l = mid + 1;
      else
        r = mid;
    }
    ins(ch, l, -1);
  }
  for (int i = 0; i <= 25; i++)
    for (int j = 1; j <= ans[i]; j++) {
      if (ask(i, j) - ask(i, j - 1) == 1) vv[f[i][j]] = 1;
    }
  for (int i = 1; i <= a[0]; i++)
    if (vv[i]) printf("%c", a[i] + 'a');
  cout << endl;
}
int main() {
  init();
  prepare();
  return 0;
}
