#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, p;
  list<char> text;
  list<char>::iterator it;
  cin >> n >> m >> p;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    text.push_back(c);
  }
  it = text.begin();
  for (int i = 1; i < p; i++) it++;
  for (int i = 0; i < m; i++) {
    char c;
    cin >> c;
    if (c == 'R')
      it++;
    else if (c == 'L')
      it--;
    else if (c == 'D') {
      int brac = 0;
      bool direction;
      if (*it == '(')
        direction = 1;
      else
        direction = 0;
      while (1) {
        list<char>::iterator tmp = it;
        if (*tmp == '(')
          brac++;
        else
          brac--;
        if (direction) {
          it++;
          text.erase(tmp);
          if (it == text.end()) it--;
        } else if (tmp == text.begin()) {
          text.pop_front();
          it = text.begin();
          if (brac == 0) break;
        } else {
          it--;
          text.erase(tmp);
        }
        if (brac == 0) {
          if (!direction) it++;
          if (it == text.end()) it--;
          break;
        }
      }
    }
  }
  for (list<char>::iterator it = text.begin(); it != text.end(); it++)
    cout << *it;
  cout << endl;
  return 0;
}
