#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, T b) {
  if (b > a) a = b;
}
int M, N;
char cs[200061];
char ans[200061];
char cs1[110];
char cs2[5];
int pos[27][200061];
int pc[27];
int tree[27][200061];
void addv(int v, int p, int t) {
  while (p < 200061) {
    tree[v][p] += t;
    p += (-p & p);
  }
}
int sum(int v, int p) {
  int ret = 0;
  while (p > 0) {
    ret += tree[v][p];
    p -= (-p & p);
  }
  return ret;
}
int getx(int v, int p) {
  int l = 1, r = 200061 - 1;
  int ret = l;
  while (l <= r) {
    int mid = (l + r) / 2;
    int t = sum(v, mid);
    if (t >= p)
      ret = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  return ret;
}
int main() {
  scanf("%d", &M);
  scanf("%s", cs1);
  int n = strlen(cs1);
  for (int i = (0); i < (int)(M); i++)
    for (int j = (0); j < (int)(n); j++) {
      cs[i * n + j] = cs1[j];
    }
  cs[M * n] = 0;
  N = M * n;
  memset((pc), 0, sizeof(pc));
  memset((pos), 0, sizeof(pos));
  memset((tree), 0, sizeof(tree));
  for (int i = (0); i < (int)(N); i++)
    pos[cs[i] - 'a'][++pc[cs[i] - 'a']] = i,
                                  addv(cs[i] - 'a', pc[cs[i] - 'a'], 1);
  scanf("%d", &n);
  for (int i = (0); i < (int)(n); i++) {
    int p;
    scanf("%d%s", &p, cs2);
    int v = cs2[0] - 'a';
    int x = getx(v, p);
    addv(v, x, -1);
    cs[pos[v][x]] = 0;
  }
  int cnt = 0;
  for (int i = (0); i < (int)(N); i++)
    if (cs[i] != 0) ans[cnt++] = cs[i];
  ans[cnt] = 0;
  printf("%s\n", ans);
  return 0;
}
