#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long double pi = 3.1415926535;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string p = s;
  for (long long i = 1; i < n; i++) s.append(p);
  map<char, vector<long long> > M;
  for (long long i = 0; i < s.size(); i++) M[s[i]].push_back(i);
  long long m;
  cin >> m;
  long long x;
  char ch;
  long long inc;
  long long a[s.size()];
  memset(a, 0, sizeof(a));
  while (m--) {
    cin >> x >> ch;
    M[ch].erase(M[ch].begin() + x - 1);
  }
  for (auto x : M) {
    for (long long i = 0; i < x.second.size(); i++) a[x.second[i]]++;
  }
  for (long long i = 0; i < s.size(); i++)
    if (a[i]) cout << s[i];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
