#include <bits/stdc++.h>
using namespace std;
int pairs[1000100];
struct Node {
  char c;
  Node *l, *r, *pp;
};
int main() {
  int n, m, p;
  cin >> n >> m >> p;
  string cbs;
  cin >> cbs;
  string ops;
  cin >> ops;
  stack<int> left_paren_idxs;
  vector<Node *> node_list;
  for (int i = 0; i < cbs.size(); ++i) {
    node_list.push_back(new Node{cbs[i]});
    if (i != 0) {
      node_list[i]->l = node_list[i - 1];
      node_list[i - 1]->r = node_list[i];
    }
    if (cbs[i] == '(') {
      left_paren_idxs.push(i);
    } else {
      int its_pair = left_paren_idxs.top();
      left_paren_idxs.pop();
      node_list[i]->pp = node_list[its_pair];
      node_list[its_pair]->pp = node_list[i];
    }
  }
  p--;
  Node *cur = node_list[p];
  Node *head = node_list[0];
  for (int i = 0; i < ops.size(); ++i) {
    if (ops[i] == 'R') {
      cur = cur->r;
    } else if (ops[i] == 'L') {
      cur = cur->l;
    } else {
      Node *left, *right;
      if (cur->c == '(') {
        left = cur->l;
        right = cur->pp->r;
      } else {
        right = cur->r;
        left = cur->pp->l;
      }
      if (left == nullptr && right == nullptr) {
        cur = nullptr;
      } else if (left == nullptr && right != nullptr) {
        cur = right;
        cur->l = nullptr;
      } else if (left != nullptr && right == nullptr) {
        cur = left;
        cur->r = nullptr;
      } else {
        left->r = right;
        right->l = left;
        cur = right;
      }
    }
  }
  if (cur == nullptr) {
    cout << endl;
    return 0;
  }
  while (cur->l) {
    cur = cur->l;
  }
  while (cur) {
    cout << cur->c;
    cur = cur->r;
  }
  cout << endl;
  return 0;
}
