#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = 0x7fffffff;
const int mod = 1e9 + 7;
list<char> l;
char s[500010], cmd[500010];
int main() {
  int n, m, st;
  scanf("%d%d%d", &n, &m, &st);
  scanf("%s", s);
  scanf("%s", cmd);
  for (int i = 0; s[i]; ++i) l.push_back(s[i]);
  list<char>::iterator it = l.begin();
  advance(it, st - 1);
  for (int i = 0; cmd[i]; ++i) {
    if (cmd[i] == 'R') {
      ++it;
      if (it == l.end()) it = l.begin();
    } else if (cmd[i] == 'L') {
      if (it == l.begin())
        it = l.end();
      else
        --it;
    } else {
      if (*it == '(') {
        int flag = 1;
        it = l.erase(it);
        while (it != l.end() && flag != 0) {
          if (*it == ')')
            --flag;
          else
            ++flag;
          it = l.erase(it);
        }
      } else if (*it == ')') {
        int flag = -1;
        it = l.erase(it);
        while (it != l.begin() && flag != 0) {
          --it;
          if (*it == ')')
            --flag;
          else
            ++flag;
          it = l.erase(it);
        }
      }
      if (it == l.end()) --it;
    }
  }
  for (it = l.begin(); it != l.end(); ++it) printf("%c", *it);
  puts("");
  return 0;
}
