#include <bits/stdc++.h>
using namespace std;
const int Max = 2e5 + 10;
const int Mod = 1e9 + 7;
const long long int Inf = 1LL << 62;
int BIT[27][Max], len;
void update(int idx, int val, int cur) {
  while (idx <= Max) {
    BIT[cur][idx] += val;
    idx += idx & -idx;
  }
}
int query(int idx, int cur) {
  int ret = 0;
  while (idx > 0) {
    ret += BIT[cur][idx];
    idx -= idx & -idx;
  }
  return ret;
}
int query(int l, int r, int cur) { return query(r, cur) - query(l - 1, cur); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int k, n, p;
  string inp, str;
  char c;
  cin >> k >> inp;
  str += "#";
  while (k--) {
    str += inp;
  }
  len = str.size() - 1;
  for (int i = 1; i <= len; i++) {
    update(i, 1, str[i] - 'a');
  }
  cin >> n;
  while (n--) {
    cin >> p >> c;
    int l = 1, r = len, idx;
    while (l <= r) {
      int mid = (l + r) >> 1;
      int res = query(1, mid, c - 'a');
      if (res >= p) {
        idx = mid;
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    update(idx, -1, c - 'a');
    str[idx] = '.';
  }
  for (char ch : str) {
    if (ch != '.' && ch != '#') {
      cout << ch;
    }
  }
  cout << endl;
  return 0;
}
