#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("s")
#pragma GCC optimize("expensive-optimizations")
#pragma GCC optimize("inline-functions")
template <class A, class B>
ostream& operator<<(ostream& o, pair<A, B>& p) {
  return o << "(" << p.first << ", " << p.second << ")";
}
template <class A, class B>
istream& operator>>(istream& i, pair<A, B>& p) {
  return i >> p.first >> p.second;
}
int tree[30][20100];
void update(int tId, int idx, int v) {
  for (; idx <= 20100; idx += (idx & -idx)) tree[tId][idx] += v;
}
int read(int tId, int idx) {
  int ret = 0;
  for (; idx > 0; idx -= (idx & -idx)) ret += tree[tId][idx];
  return ret;
}
string str;
int strLCount[30];
int charTree[2010][30][110];
void updateChar(int wNum, int letter, int idx, int v) {
  for (; idx <= 110; idx += (idx & -idx)) charTree[wNum][letter][idx] += v;
}
int readChar(int wNum, int letter, int idx) {
  int ret = 0;
  for (; idx > 0; idx -= (idx & -idx)) ret += charTree[wNum][letter][idx];
  return ret;
}
void deleteChar(int wNum, int which, int chr) {
  int low = 1, high = strLCount[chr];
  while (low < high) {
    int mid = (low + high) / 2;
    int cc = readChar(wNum, chr, mid);
    if (which <= cc)
      high = mid;
    else
      low = mid + 1;
  }
  updateChar(wNum, chr, low, -1);
}
int main() {
  ;
  int numRepeat = ({
    int a;
    scanf(" %d", &a);
    a;
  });
  cin >> str;
  for (typeof(((int)str.size()) - 1) i = (0); i <= (((int)str.size()) - 1);
       i++) {
    int chr = str[i] - 'a';
    strLCount[chr]++;
    for (typeof(numRepeat) wNum = (1); wNum <= (numRepeat); wNum++)
      updateChar(wNum, chr, strLCount[chr], 1);
  }
  int numChanges = ({
    int a;
    scanf(" %d", &a);
    a;
  });
  for (typeof((numChanges)-1) i = (0); i <= ((numChanges)-1); i++) {
    int pos;
    char letter;
    cin >> pos >> letter;
    int chr = letter - 'a';
    int low = 1, high = numRepeat;
    while (low < high) {
      int mid = (low + high) / 2;
      int cc = mid * strLCount[chr] - read(chr, mid);
      if (pos <= cc)
        high = mid;
      else
        low = mid + 1;
    }
    update(chr, low, 1);
    pos -= (low - 1) * strLCount[chr] - read(chr, low - 1);
    deleteChar(low, pos, chr);
  }
  for (typeof(numRepeat) wNum = (1); wNum <= (numRepeat); wNum++) {
    int cc[30] = {0};
    for (typeof(((int)str.size()) - 1) i = (0); i <= (((int)str.size()) - 1);
         i++) {
      int chr = str[i] - 'a';
      cc[chr]++;
      int exists =
          readChar(wNum, chr, cc[chr]) - readChar(wNum, chr, cc[chr] - 1);
      if (exists) cout << str[i];
    }
  }
  cout << endl;
  return 0;
}
