#include <bits/stdc++.h>
using namespace std;
struct Node {
  int left, right, match;
  Node() : left(0), right(0), match(0) {}
};
void print(vector<Node> &br, int first) {
  int k = first;
  while (k != -1) {
    if (br[k].match > k) {
      cout << "(";
    } else {
      cout << ")";
    }
    k = br[k].right;
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cin.tie(0), cout.tie(0),
      cout.precision(15);
  int n, m, p;
  cin >> n >> m >> p;
  p--;
  vector<Node> br(n, Node());
  string s;
  cin >> s;
  stack<int> st;
  for (int i = int(0); i < int(n); i++) {
    br[i].left = i - 1;
    br[i].right = i + 1;
    if (s[i] == '(') {
      st.push(i);
    } else {
      br[st.top()].match = i;
      br[i].match = st.top();
      st.pop();
    }
  }
  br[n - 1].right = -1;
  int first = 0;
  string ops;
  cin >> ops;
  for (int i = int(0); i < int(ops.size()); i++) {
    if (ops[i] == 'R')
      p = br[p].right;
    else if (ops[i] == 'L')
      p = br[p].left;
    else {
      if (br[p].match > p) {
        br[br[p].left].right = br[br[p].match].right;
        br[br[br[p].match].right].left = br[p].left;
        if (p == first) {
          first = br[br[p].match].right;
        }
        int pp = br[br[p].match].right;
        if (pp == -1) pp = br[p].left;
        p = pp;
      } else {
        br[br[p].right].left = br[br[p].match].left;
        br[br[br[p].match].left].right = br[p].right;
        if (br[p].match == first) {
          first = br[p].right;
        }
        int pp = br[p].right;
        if (pp == -1) pp = br[br[p].match].left;
        p = pp;
      }
    }
  }
  print(br, first);
}
