#include <bits/stdc++.h>
using namespace std;
const int maxN = 200000 + 4;
vector<int> m[400];
bool notUsed[maxN];
int main() {
  int k;
  cin >> k;
  string s;
  cin >> s;
  int n = (int)s.size();
  int add = 0;
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < n; ++j) {
      m[s[j]].push_back(j + add);
    }
    add += n;
  }
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    int pos;
    char ch;
    cin >> pos >> ch;
    --pos;
    notUsed[m[ch][pos]] = true;
    m[ch].erase(m[ch].begin() + pos);
  }
  for (int i = 0; i < n * k; ++i) {
    if (notUsed[i] == false) {
      cout << s[i % n];
    }
  }
  return 0;
}
