#include <bits/stdc++.h>
using namespace std;
int n, k, m;
int Min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}
vector<vector<int>> act = vector<vector<int>>(50, vector<int>(0, 0));
vector<string> res;
vector<vector<int>> nres;
vector<int> temp = vector<int>(26, 0);
string s;
int main() {
  int f = 0;
  char d = 0;
  int fuuu = 0;
  cin >> k;
  cin >> s;
  cin >> n;
  for (int(i) = (0); (i) < (k); (i)++) res.push_back(s);
  d = s.size();
  for (int(i) = (0); (i) < (d); (i)++) temp[s[i] - 'a']++;
  for (int(i) = (0); (i) < (k); (i)++) nres.push_back(temp);
  for (int(i) = (0); (i) < (n); (i)++) {
    cin >> f >> d;
    d -= 'a';
    act[d].push_back(f);
  }
  int lenn = 0;
  int te = 0;
  for (int(i) = (0); (i) < (26); (i)++) {
    lenn = act[i].size();
    for (int(j) = (0); (j) < (lenn); (j)++) {
      f = 0;
      fuuu = 0;
      while (fuuu < act[i][j]) {
        fuuu += nres[f][i];
        f++;
      }
      f--;
      fuuu -= nres[f][i];
      n = res[f].length();
      te = 0;
      for (int(p) = (0); (p) < (n); (p)++) {
        if ((res[f][p] - 'a') == i) {
          if (te + fuuu + 1 == act[i][j]) {
            res[f].erase(res[f].begin() + p);
            nres[f][i]--;
            break;
          } else
            te++;
        }
      }
    }
  }
  n = res.size();
  for (int(i) = (0); (i) < (n); (i)++) cout << res[i];
  return 0;
}
