#include <bits/stdc++.h>
using namespace std;
void optimize() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
struct Node {
  int id;
  struct Node* next;
  struct Node* prev;
};
int main() {
  int n, m, p;
  cin >> n >> m >> p;
  string s, op;
  cin >> s >> op;
  stack<int> pi;
  vector<pair<int, int>> b(n);
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      b[i].first = i;
      pi.push(i);
    } else {
      b[i].second = i;
      b[pi.top()].second = i;
      b[i].first = b[pi.top()].first;
      pi.pop();
    }
  }
  p--;
  struct Node* head = new Node;
  struct Node* last = new Node;
  head->id = 0;
  head->prev = NULL;
  last = head;
  for (int i = 1; i < n; i++) {
    struct Node* c = new Node;
    last->next = c;
    c->id = i;
    c->prev = last;
    last = c;
  }
  last->next = NULL;
  last = head;
  while (last->id != p) {
    last = last->next;
  }
  for (int i = 0; i < m; i++) {
    if (op[i] == 'L') {
      last = last->prev;
    } else if (op[i] == 'R') {
      last = last->next;
    } else {
      if (s[last->id] == '(') {
        struct Node* it = last;
        while (it->id != b[last->id].second) {
          it = it->next;
        }
        if (last->prev != NULL) last->prev->next = it->next;
        if (it->next != NULL) it->next->prev = last->prev;
        if (last->prev == NULL) {
          head = it->next;
        }
        if (it->next == NULL) {
          last = last->prev;
        } else {
          last = it->next;
        }
      } else {
        struct Node* it = last;
        while (it->id != b[last->id].first) {
          it = it->prev;
        }
        if (last->next != NULL) last->next->prev = it->prev;
        if (it->prev != NULL) it->prev->next = last->next;
        if (last->next == NULL) {
          last = it->prev;
        } else {
          last = last->next;
        }
        if (it->prev == NULL) {
          head = last;
        }
      }
    }
  }
  while (head != NULL) {
    cout << s[head->id];
    head = head->next;
  }
  cout << "\n";
}
