#include <bits/stdc++.h>
using namespace std;
map<char, vector<int>> mm;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k, i, j, q;
  string second, ss = "";
  cin >> k >> second >> n;
  for (i = 0; i < k; ++i) ss += second;
  for (i = 0; i < second.size(); ++i)
    for (j = 0, q = 0; q < k; ++q, j += second.size())
      mm[second[i]].push_back(i + j);
  for (char c = 'a'; c <= 'z'; ++c) sort(mm[c].begin(), mm[c].end());
  for (i = 0; i < n; ++i) {
    int in;
    char ch;
    cin >> in >> ch;
    in--;
    ss[mm[ch][in]] = '0';
    mm[ch].erase(mm[ch].begin() + in);
  }
  for (i = 0; i < ss.size(); ++i)
    if (ss[i] != '0') cout << ss[i];
}
