#include <bits/stdc++.h>
using namespace std;
void Print(vector<int> a) {
  for (int i = 0; i < a.size(); ++i) {
    cout << abs(a[i]) << " ";
  }
}
long long ToLL(string num) {
  long long ans = 0;
  for (int i = 0; i < num.size(); ++i) {
    ans *= 10;
    ans += (num[i] - '0');
  }
  return ans;
}
string ToType0(int a, int b) {
  string ans;
  stringstream ss(ans);
  b--;
  string tmp;
  while (b >= 0) {
    tmp += (char)('A' + b % 26);
    b /= 26;
    b--;
  }
  reverse(tmp.begin(), tmp.end());
  ss << tmp;
  ss << a;
  ss >> ans;
  return ans;
}
string ToType1(string t0) {
  string ss_str;
  stringstream ss(ss_str);
  int row = 0;
  string r_str;
  string col_str;
  for (int i = 0; i < t0.size(); ++i) {
    if (t0[i] >= '0' && t0[i] <= '9') {
      r_str = t0.substr(0, i);
      col_str = t0.substr(i, t0.size() - i);
      break;
    }
  }
  ss << col_str;
  int col;
  ss >> col;
  for (int i = 0; i < r_str.size(); ++i) {
    row *= 26;
    row += (r_str[i] - 'A' + 1);
  }
  ss.clear();
  ss << 'R' << col << 'C' << row;
  string ans;
  ss >> ans;
  return ans;
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  int k;
  string ts;
  cin >> k >> ts;
  vector<int> tmp(26, 0);
  vector<string> S(k);
  for (int i = 0; i < ts.size(); ++i) {
    tmp[ts[i] - 'a']++;
  }
  vector<vector<int> > A(k);
  for (int i = 0; i < k; ++i) {
    A[i] = tmp;
    S[i] = ts;
  }
  int m;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    int pos;
    char c;
    cin >> pos >> c;
    for (int j = 0; j < k; ++j) {
      if (A[j][c - 'a'] >= pos) {
        for (int l = 0; l < ts.size(); ++l) {
          if (S[j][l] == c) pos--;
          if (pos == 0) {
            S[j][l] = ' ';
            A[j][c - 'a']--;
            break;
          }
        }
        break;
      } else {
        pos -= A[j][c - 'a'];
      }
    }
  }
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < ts.size(); ++j) {
      if (S[i][j] != ' ') cout << S[i][j];
    }
  }
  return 0;
}
