#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
class Seg {
  int l, m, r;
  int val;
  Seg* ch[2];
  void pull() { val = ch[0]->val + ch[1]->val; }

 public:
  Seg(int l, int r) : m(l + r >> 1), l(l), r(r) {
    val = 1;
    if (r - l > 1) {
      ch[0] = new Seg(l, m);
      ch[1] = new Seg(m, r);
      pull();
    }
  }
  void sub_kth(int k) {
    assert(k <= val);
    if (r - l == 1)
      val -= 1;
    else {
      if (ch[0]->val >= k)
        ch[0]->sub_kth(k);
      else
        ch[1]->sub_kth(k - ch[0]->val);
      pull();
    }
  }
  void dfs(string& s, char c, vector<int>& dict) {
    if (r - l == 1) {
      if (val) s[dict[l]] = c;
    } else {
      ch[0]->dfs(s, c, dict);
      ch[1]->dfs(s, c, dict);
    }
  }
};
class Solution {
  Seg* Ts[26];
  int k, n;
  string s;

 public:
  void run() {
    cin >> k;
    cin >> s;
    cin >> n;
    vector<int> dict[26];
    for (int i = 0; i < s.size(); ++i) {
      for (int j = 0; j < k; ++j) dict[s[i] - 'a'].push_back(i + s.size() * j);
    }
    for (int i = 0; i < 26; ++i)
      if (dict[i].size()) {
        sort(dict[i].begin(), dict[i].end());
        Ts[i] = new Seg(0, dict[i].size());
      }
    while (n--) {
      int p;
      char c;
      cin >> p >> c;
      Ts[c - 'a']->sub_kth(p);
    }
    string ans(k * s.size(), ' ');
    for (int j = 0; j < 26; ++j)
      if (dict[j].size()) Ts[j]->dfs(ans, 'a' + j, dict[j]);
    for (int i = 0; i < ans.size(); ++i)
      if (ans[i] != ' ') cout << ans[i];
    cout << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  Solution().run();
}
