#include <bits/stdc++.h>
int main() {
  int n, m, p;
  scanf("%d%d%d", &n, &m, &p);
  std::string str;
  std::cin >> str;
  std::string order;
  std::cin >> order;
  std::list<char> list;
  for (int i = 0; i < str.size(); i++) {
    list.push_back(str[i]);
  }
  std::list<char>::iterator cur = list.begin();
  for (int i = 0; i < p - 1; i++) {
    cur++;
  }
  for (char ch : order) {
    if (ch == 'R') {
      cur++;
    }
    if (ch == 'L') {
      cur--;
    }
    if (ch == 'D') {
      int offset = 0;
      if (*cur == '(') {
        do {
          if (*cur == '(') {
            offset++;
          } else {
            offset--;
          }
          cur = list.erase(cur);
        } while (offset != 0);
        if (cur == list.end()) {
          cur--;
        }
      } else {
        do {
          if (*cur == '(') {
            offset++;
          } else {
            offset--;
          }
          cur = list.erase(cur);
          if (offset == 0) {
            break;
          }
          cur--;
        } while (offset != 0);
        if (cur == list.end()) {
          cur--;
        }
      }
    }
  }
  std::string print = "";
  for (char i : list) {
    print += i;
  }
  printf("%s", print.c_str());
}
