#include <bits/stdc++.h>
using namespace std;
int n, m, p, init, target, bracket[500005];
string s, q;
set<int> sets;
stack<int> st;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> p >> s >> q;
  p--;
  for (int i = 0; i < n; i++) {
    sets.insert(i);
    if (s[i] == '(') {
      st.push(i);
    } else {
      bracket[st.top()] = i;
      bracket[i] = st.top();
      st.pop();
    }
  }
  auto it = sets.begin();
  for (int i = 0; i < p; i++) {
    it++;
  }
  for (int i = 0; i < m; i++) {
    if (q[i] == 'R') {
      it++;
    } else if (q[i] == 'L') {
      it--;
    } else {
      if (*it < bracket[*it]) {
        init = *it, target = bracket[*it];
      } else {
        init = bracket[*it], target = *it;
      }
      it = sets.lower_bound(init);
      while (1) {
        bool done = (*it == target);
        sets.erase(it);
        it = sets.lower_bound(init);
        if (it == sets.end()) {
          it--;
        }
        if (done) {
          break;
        }
      }
    }
  }
  for (auto it2 = sets.begin(); it2 != sets.end(); it2++) {
    cout << s[*it2];
  }
  cout << '\n';
  return 0;
}
