#include <bits/stdc++.h>
using namespace std;
int d[2001][101];
string s;
char c;
int n, m, k, i, j, p, ll, rr, cur, mid, l, r, q, x, K, b;
int f[30];
int a[30][2005];
int tree[30][100001];
void build(int ind, int L, int R, int D) {
  if (L == R) {
    tree[D][ind] = a[D][L];
    return;
  }
  build(2 * ind, L, (L + R) / 2, D);
  build(2 * ind + 1, (L + R) / 2 + 1, R, D);
  tree[D][ind] = tree[D][2 * ind] + tree[D][2 * ind + 1];
}
void upd(int ind, int L, int R, int D) {
  if (L > rr || R < ll) return;
  if (L >= ll && R <= rr) {
    tree[D][ind]--;
    return;
  }
  upd(2 * ind, L, (L + R) / 2, D);
  upd(2 * ind + 1, (L + R) / 2 + 1, R, D);
  tree[D][ind] = tree[D][2 * ind] + tree[D][2 * ind + 1];
}
int Get_Ans(int ind, int L, int R, int D) {
  if (L > rr || R < ll) return 0;
  if (L >= ll && R <= rr) return tree[D][ind];
  return (Get_Ans(2 * ind, L, (L + R) / 2, D) +
          Get_Ans(2 * ind + 1, (L + R) / 2 + 1, R, D));
}
int main() {
  cin >> k;
  cin >> s;
  m = s.size();
  cin >> n;
  for (i = 0; i < m; i++) f[s[i] - 'a']++;
  for (i = 1; i <= k; i++)
    for (j = 0; j <= 25; j++) a[j][i] = f[j];
  for (j = 0; j <= 25; j++) build(1, 1, k, j);
  ll = 1;
  rr = 3;
  while (n--) {
    cin >> p >> c;
    l = 1;
    r = k;
    mid = 0;
    while (l <= r) {
      q = (l + r) / 2;
      ll = 1;
      rr = q;
      if (Get_Ans(1, 1, k, c - 'a') >= p) {
        mid = q;
        r = q - 1;
      } else
        l = q + 1;
    }
    q = mid;
    ll = 1;
    rr = q - 1;
    cur = Get_Ans(1, 1, k, c - 'a');
    for (j = 0; j < m && cur < p; j++)
      if (!d[q][j] && s[j] == c) {
        cur++;
        if (cur == p) d[q][j] = 1;
      }
    ll = q;
    rr = q;
    upd(1, 1, k, c - 'a');
  }
  for (i = 1; i <= k; i++)
    for (j = 0; j < m; j++)
      if (!d[i][j]) cout << s[j];
  cin >> n;
}
