#include <bits/stdc++.h>
using namespace std;
int repeats, len;
char str[(1 << 7)];
bool used[(1 << 5)][(1 << 18)];
int it[(1 << 5)][(1 << 18)];
inline int query(int id, int x) {
  int ans = 0;
  int pos = x;
  for (; x; x = x & (x - 1)) ans += it[id][x];
  return pos - ans;
}
inline int findRealPos(char ch, int pos) {
  int id = ch - 'a';
  int l = -1, r = repeats * len - pos, mid;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (query(id, pos + mid) < pos) {
      l = mid;
    } else {
      r = mid;
    }
  }
  return pos + r;
}
inline void update(char ch, int x) {
  int id = ch - 'a';
  for (; x < (1 << 18); x += x & (-x)) it[id][x]++;
}
inline void readAndSolve() {
  scanf("%d", &repeats);
  scanf("%s", str);
  len = strlen(str);
  int q;
  scanf("%d", &q);
  getc(stdin);
  char c[40];
  for (int i = 0; i < q; ++i) {
    int id;
    char ch;
    scanf("%d %s", &id, c);
    ch = c[0];
    int cur = findRealPos(ch, id);
    used[ch - 'a'][cur] = true;
    update(ch, cur);
  }
}
int idx[(1 << 5)];
inline void print() {
  for (int i = 0; i < repeats; ++i) {
    for (int j = 0; j < len; ++j) {
      int ch = str[j] - 'a';
      int cur = ++idx[ch];
      if (used[ch][cur] == true) continue;
      printf("%c", str[j]);
    }
  }
  printf("\n");
}
int main() {
  readAndSolve();
  print();
  return 0;
}
