#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
const int MX = 2000 * 100 + 1000;
char arr[MX], c;
bool erased[MX];
vector<int> idxs[128];
int main() {
  int k, n, len, id;
  string str;
  cin >> k >> str >> n;
  len = (int)str.size();
  for (int i = 0; i < len; ++i)
    for (int j = 0; j < k; ++j)
      idxs[(int)str[i]].push_back(i + j * len), arr[i + j * len] = str[i];
  arr[(int)str.size() * k] = '\0';
  for (int i = 'a'; i <= 'z'; ++i) sort(idxs[i].begin(), idxs[i].end());
  memset(erased, 0, sizeof erased);
  while (n--) {
    cin >> id >> c;
    int id1 = idxs[(int)c][--id];
    erased[id1] = 1;
    idxs[(int)c].erase(idxs[(int)c].begin() + id);
  }
  for (int i = 0; i < (int)str.size() * k; ++i)
    if (!erased[i]) cout << arr[i];
  return 0;
}
