#include <bits/stdc++.h>
using namespace std;
struct Segtree {
  int cnt[1 << 19];
  void modify(int t, int lb, int rb, int k, int v) {
    if (rb - lb == 1) return cnt[t] += v, void();
    int mb = lb + rb >> 1;
    if (k < mb)
      modify(t << 1, lb, mb, k, v);
    else
      modify(t << 1 | 1, mb, rb, k, v);
    cnt[t] = cnt[t << 1] + cnt[t << 1 | 1];
  }
  int query(int t, int lb, int rb, int k) {
    if (rb - lb == 1) return cnt[t];
    int mb = lb + rb >> 1;
    if (k < mb) return query(t << 1, lb, mb, k);
    return query(t << 1 | 1, mb, rb, k);
  }
  void erase(int t, int lb, int rb, int k) {
    if (rb - lb == 1) return cnt[t] = 0, void();
    int mb = lb + rb >> 1;
    if (cnt[t << 1] >= k)
      erase(t << 1, lb, mb, k);
    else
      erase(t << 1 | 1, mb, rb, k - cnt[t << 1]);
    cnt[t] = cnt[t << 1] + cnt[t << 1 | 1];
  }
} root[26];
signed main() {
  ios::sync_with_stdio(false);
  int K;
  cin >> K;
  string S;
  cin >> S;
  string T;
  for (int i = 0; i < K; ++i) {
    T += S;
  }
  for (int i = 0; i < T.size(); ++i) {
    root[T[i] - 'a'].modify(1, 0, T.size(), i, 1);
  }
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int P;
    string C;
    cin >> P >> C;
    root[C[0] - 'a'].erase(1, 0, T.size(), P);
  }
  string ans;
  for (int i = 0; i < T.size(); ++i) {
    if (root[T[i] - 'a'].query(1, 0, T.size(), i)) {
      ans += T[i];
    }
  }
  cout << ans << endl;
  return 0;
}
