#include <bits/stdc++.h>
using namespace std;
int n, len, k;
int cnt[2002][26];
bool v[2000 * 100 + 2];
char ch[102];
int main() {
  cin >> n >> ch >> k;
  len = strlen(ch);
  for (int i = 0; i < len; ++i) {
    ++cnt[0][ch[i] - 'a'];
  }
  for (int i = 1; i < n; ++i)
    for (int j = 0; j < 26; ++j) cnt[i][j] = cnt[0][j];
  while (k--) {
    char s[6];
    int x, y = 0, z = -1;
    scanf("%d%s", &x, s);
    for (int j = 0; j < n && x > cnt[j][s[0] - 'a']; ++j) {
      x -= cnt[j][s[0] - 'a'];
      y = j + 1;
    }
    for (int j = 0; j < len && x; ++j)
      if (ch[j] == s[0] && !v[y * len + j]) {
        --x;
        z = j;
      }
    assert(x == 0);
    assert(z != -1);
    v[y * len + z] = true;
    --cnt[y][s[0] - 'a'];
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < len; ++j)
      if (!v[i * len + j]) putchar(ch[j]);
  puts("");
  return 0;
}
