#include <bits/stdc++.h>
using namespace std;
const int maxN = 5e5 + 10;
struct brac {
  int left, right, value;
} L[maxN];
int N, M, P, cur;
char S[maxN], Q[maxN];
int main() {
  scanf("%d%d%d\n", &N, &M, &P);
  gets(S + 1);
  gets(Q + 1);
  for (int i = 1; i <= N; i++) {
    L[i].value = S[i] == '(' ? 1 : -1;
    L[i].left = i - 1;
    L[i].right = i + 1;
  }
  cur = P;
  L[0].right = 1;
  L[N + 1].left = N;
  for (int i = 1; i <= M; i++) {
    if (Q[i] == 'L') cur = L[cur].left;
    if (Q[i] == 'R') cur = L[cur].right;
    if (Q[i] == 'D') {
      int sum = L[cur].value, old = cur;
      if (sum == 1) {
        while (sum != 0) {
          cur = L[cur].right;
          sum += L[cur].value;
        }
        L[L[old].left].right = L[cur].right;
        L[L[cur].right].left = L[old].left;
        cur = L[cur].right;
        if (cur > N) cur = L[cur].left;
      } else {
        while (sum != 0) {
          cur = L[cur].left;
          sum += L[cur].value;
        }
        L[L[old].right].left = L[cur].left;
        L[L[cur].left].right = L[old].right;
        cur = L[old].right;
        if (cur > N) cur = L[cur].left;
      }
    }
  }
  cur = 0;
  while (cur <= N) {
    if (L[cur].value == 1) printf("(");
    if (L[cur].value == -1) printf(")");
    cur = L[cur].right;
  }
}
