#include <bits/stdc++.h>
using namespace std;
int n, m, p;
vector<int> v;
int main() {
  cin >> n >> m >> p;
  scanf("%d %d %d", &n, &m, &p);
  p--;
  char str[n];
  scanf("%s", str);
  list<char> lista;
  for (int i = 0; i < n; i++) {
    lista.push_back(str[i]);
  }
  char op[m];
  scanf("%s", op);
  list<char>::iterator it = lista.begin();
  advance(it, p);
  for (int i = 0; i < m; i++) {
    ;
    if (op[i] == 'R') it = next(it);
    if (op[i] == 'L') it = prev(it);
    if (op[i] == 'D') {
      int id = distance(lista.begin(), it);
      stack<char> aux;
      aux.push(*it);
      list<char>::iterator auxIt = it;
      int cnt = 0;
      bool check = false;
      if (aux.top() == '(') {
        check = true;
        while (!aux.empty()) {
          auxIt = next(auxIt);
          if (*auxIt == ')') {
            aux.pop();
            cnt += 2;
          } else
            aux.push(*auxIt);
        }
        list<char>::iterator it2 = next(it, cnt);
        it = lista.erase(it, it2);
      } else {
        while (!aux.empty()) {
          auxIt = prev(auxIt);
          if (*auxIt == '(') {
            aux.pop();
            cnt += 2;
          } else
            aux.push(*auxIt);
        }
        it = next(it);
        list<char>::iterator it2 = prev(it, cnt);
        it = lista.erase(it2, it);
      }
      if (it == lista.end()) {
        it--;
      }
    }
  }
  for (list<char>::iterator i = lista.begin(); i != lista.end(); i++) {
    printf("%c", *i);
  }
  printf("\n");
  return 0;
}
