#include <bits/stdc++.h>
static const int INF = std::numeric_limits<int>::max();
int main() {
  int k;
  std::string s;
  std::cin >> k >> s;
  std::vector<int> cnt(26);
  for (int i = 0; i < (int)s.size(); ++i) {
    ++cnt[s[i] - 'a'];
  }
  std::vector<std::vector<int> > counts(k, cnt);
  std::vector<std::string> strings(k, s);
  int n;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    int p;
    char c;
    std::cin >> p >> c;
    int sum = 0;
    for (int j = 0; j < k; ++j) {
      if (p <= sum + counts[j][c - 'a']) {
        int x = p - sum;
        for (int l = 0; l < (int)strings[j].size(); ++l) {
          if (strings[j][l] == c) {
            --x;
            if (x == 0) {
              strings[j][l] = '*';
              --counts[j][c - 'a'];
              break;
            }
          }
        }
        assert(x == 0);
        break;
      } else {
        sum += counts[j][c - 'a'];
      }
    }
  }
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < (int)strings[i].size(); ++j) {
      if (strings[i][j] != '*') {
        std::cout << strings[i][j];
      }
    }
  }
  std::cout << std::endl;
}
