#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 100 * 1000 + 10;
int arr[MAXN], nx[MAXN], bf[MAXN];
stack<int> st;
pair<int, int> pr[MAXN];
int main() {
  int n, m, p;
  cin >> n >> m >> p;
  string second, w;
  cin >> second >> w;
  second = " " + second;
  int cntr = 1;
  for (int i = 1; i < second.size(); i++) {
    if (second[i] == '(') {
      arr[i] = cntr;
      pr[cntr].first = i;
      st.push(cntr);
      cntr++;
    } else {
      arr[i] = st.top();
      pr[arr[i]].second = i;
      st.pop();
    }
    nx[i] = i + 1;
    bf[i] = i - 1;
  }
  nx[0] = 1;
  for (int i = 0; i < w.size(); i++) {
    if (w[i] == 'R')
      p = nx[p];
    else if (w[i] == 'L')
      p = bf[p];
    else {
      int sr = pr[arr[p]].first;
      int er = pr[arr[p]].second;
      nx[bf[sr]] = nx[er];
      bf[nx[er]] = bf[sr];
      if (nx[er] < second.size())
        p = nx[er];
      else
        p = bf[sr];
    }
  }
  int i = nx[0];
  while (i < second.size()) {
    cout << second[i];
    i = nx[i];
  }
  cout << endl;
}
