#include <bits/stdc++.h>
using namespace std;
int getint() {
  unsigned int c;
  int x = 0;
  while (((c = getchar()) - '0') >= 10) {
    if (c == '-') return -getint();
    if (!~c) exit(0);
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while (((c = getchar()) - '0') < 10);
  return x;
}
int getc_str(char str[]) {
  unsigned int c, n = 0;
  while ((c = getchar()) <= ' ')
    ;
  if (!~c) exit(0);
  do {
    str[n++] = c;
  } while ((c = getchar()) > ' ');
  str[n] = '\0';
  return n;
}
int get_char() {
  int c;
  for (; (c = getchar()) <= ' ';) {
    if (!~c) exit(0);
  }
  return c;
}
template <class T>
struct FenwickTree {
  static const int N = 2000 * 100 + 100;
  int n;
  T data[N];
  void init(int size, T u = 0) { n = size, fill(data, data + n, u); }
  T sum(int srt, int end) { return sum(end) - sum(srt - 1); }
  T sum(int end) {
    T s = 0;
    for (; end >= 0; end = (end & end + 1) - 1) s += data[end];
    return s;
  }
  void add(int pos, T val) {
    for (; pos < n; pos |= pos + 1) data[pos] += val;
  }
};
char in[111];
char full[2000 * 100 + 1000];
FenwickTree<int> bit[27];
int main() {
  int i, j, tcc, tc = 1 << 28;
  for (tcc = 0; tcc < tc; tcc++) {
    int k = getint();
    int n = getc_str(in);
    for (i = 0; i < k; i++) {
      for (j = 0; j < n; j++) {
        full[i * n + j] = in[j];
      }
    }
    n = k * n;
    for (i = 0; i < 27; i++) bit[i].init(n);
    for (i = 0; i < n; i++) {
      bit[full[i] - 'a'].add(i, 1);
    }
    int Q = getint(), q;
    for (q = 0; q < Q; q++) {
      int p = getint(), c = get_char() - 'a';
      int lt = 0, rg = n, md;
      while (lt <= rg) {
        md = (lt + rg) / 2;
        int cnt = bit[c].sum(md);
        if (cnt < p) {
          lt = md + 1;
        } else {
          rg = md - 1;
        }
      }
      full[lt] = '~';
      bit[c].add(lt, -1);
    }
    for (i = 0; i < n; i++) {
      if (full[i] != '~') putchar(full[i]);
    }
    puts("");
  }
  return 0;
}
