#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &o, vector<T> v) {
  if (v.size() > 0) o << v[0];
  for (unsigned i = 1; i < v.size(); i++) o << " " << v[i];
  return o << endl;
}
template <typename U, typename V>
ostream &operator<<(ostream &o, pair<U, V> p) {
  return o << "(" << p.first << ", " << p.second << ") ";
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (unsigned i = 0; i < v.size(); i++) in >> v[i];
  return in;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, p;
  cin >> n >> m >> p;
  string s;
  cin >> s;
  list<char> seq((s).begin(), (s).end());
  string c;
  cin >> c;
  auto it = seq.begin();
  for (int(i) = 0; (i) < (int)(p - 1); ++(i)) it++;
  for (int(i) = 0; (i) < (int)(m); ++(i)) {
    if (c[i] == 'R') {
      it++;
    } else if (c[i] == 'L')
      it--;
    else {
      char b = *it;
      if (b == '(') {
        int cnt = 1;
        auto beg = it;
        it++;
        while (cnt > 0) {
          b = *it;
          if (b == ')')
            cnt--;
          else
            cnt++;
          it++;
        }
        seq.erase(beg, it);
        if (it == seq.end()) it--;
      } else {
        auto oit = it;
        oit++;
        int cnt = 1;
        while (cnt > 0) {
          it--;
          b = *it;
          if (b == ')')
            cnt++;
          else
            cnt--;
        }
        seq.erase(it, oit);
        it = oit;
        if (it == seq.end()) it--;
      }
    }
  }
  string res;
  for (char c : seq) res += c;
  cout << res << endl;
}
