#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
pair<char, int> Map[maxn];
pair<int, int> jump[maxn];
stack<int> sv;
char c[maxn] = {'\0'};
int main() {
  int j, i, n, no, cursor, m, p;
  scanf("%d%d%d", &n, &m, &p);
  scanf("%s", c);
  for (i = 0; i < n; i++) {
    if (c[i] == '(') {
      sv.push(i + 1);
    } else {
      no = sv.top();
      Map[no] = make_pair('(', i + 1);
      Map[i + 1] = make_pair(')', no);
      sv.pop();
    }
    jump[i].first = i + 1;
    jump[i].second = i - 1;
  }
  jump[n].first = n + 1;
  jump[n].second = n - 1;
  jump[n + 1].first = n + 2;
  jump[n + 1].second = n;
  memset(c, 0, sizeof(c));
  scanf("%s", c);
  cursor = p;
  for (i = 0; i < m; i++) {
    if (c[i] == 'R') {
      cursor = jump[cursor].first;
    } else if (c[i] == 'L') {
      cursor = jump[cursor].second;
    } else if (c[i] == 'D') {
      if (Map[cursor].first == '(') {
        jump[jump[cursor].second].first = jump[Map[cursor].second].first;
        jump[jump[Map[cursor].second].first].second = jump[cursor].second;
        cursor = jump[Map[cursor].second].first;
      } else if (Map[cursor].first == ')') {
        jump[jump[cursor].first].second = jump[Map[cursor].second].second;
        jump[jump[Map[cursor].second].second].first = jump[cursor].first;
        cursor = jump[cursor].first;
      }
      if (cursor == n + 1) {
        cursor = jump[cursor].second;
      }
    }
  }
  for (i = jump[0].first; i != n + 1; i = jump[i].first) {
    printf("%c", Map[i].first);
  }
}
