#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n, m, p, l[N], r[N], pp[N];
char s[N], opt[N];
stack<int> st;
int main() {
  scanf("%d%d%d", &n, &m, &p);
  scanf("%s%s", s + 1, opt + 1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      st.push(i);
    else {
      int cur = st.top();
      pp[cur] = i;
      pp[i] = cur;
      st.pop();
    }
  }
  for (int i = 0; i <= n; i++) r[i] = i + 1;
  for (int i = 1; i <= n + 1; i++) l[i] = i - 1;
  for (int i = 1; i <= m; i++) {
    if (opt[i] == 'L')
      p = l[p];
    else if (opt[i] == 'R')
      p = r[p];
    else {
      if (s[p] == '(') {
        r[l[p]] = r[pp[p]];
        l[r[pp[p]]] = l[p];
        p = (r[pp[p]] == n + 1) ? l[p] : r[pp[p]];
      } else {
        l[r[p]] = l[pp[p]];
        r[l[pp[p]]] = r[p];
        p = (r[p] == n + 1) ? l[pp[p]] : r[p];
      }
    }
  }
  int cur = 0;
  while (r[cur] != n + 1) {
    cur = r[cur];
    printf("%c", s[cur]);
  }
  printf("\n");
  return 0;
}
