#include <bits/stdc++.h>
using namespace std;
void openfile() {}
const int M = 200000 + 11;
struct smt {
  int sm[M << 2];
  void build(int p, int l, int r) {
    if (l == r)
      sm[p] = 1;
    else {
      int mid = l + r >> 1;
      build(p << 1, l, mid);
      build(p << 1 | 1, mid + 1, r);
      sm[p] = sm[p << 1] + sm[p << 1 | 1];
    }
  }
  int find(int p, int l, int r, int x) {
    sm[p]--;
    if (l == r)
      return l;
    else {
      int mid = l + r >> 1;
      if (sm[p << 1] >= x)
        return find(p << 1, l, mid, x);
      else
        return find(p << 1 | 1, mid + 1, r, x - sm[p << 1]);
    }
  }
} seg[26];
char s[111];
int main() {
  openfile();
  int k, n, m, i, j, maxn = 200000, x, y;
  while (cin >> k) {
    scanf("%s", s);
    n = strlen(s);
    cin >> m;
    for (i = 0; i < 26; ++i) seg[i].build(1, 1, maxn);
    vector<int> pos[26];
    for (i = 0; i < m; ++i) {
      char c;
      scanf("%d %c", &x, &c);
      x = seg[c - 'a'].find(1, 1, maxn, x);
      pos[c - 'a'].push_back(x);
    }
    for (i = 0; i < 26; ++i) sort(pos[i].begin(), pos[i].end());
    int sum[26] = {0};
    int index[26] = {0};
    while (k--) {
      for (i = 0; i < n; ++i) {
        int c = s[i] - 'a';
        sum[c]++;
        if (index[c] < pos[c].size() && sum[c] == pos[c][index[c]])
          ++index[c];
        else
          putchar(s[i]);
      }
    }
    puts("");
  }
}
