#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long long INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAX = 5 * 1000 * 100 + 47;
string s, t, res;
char ch[MAX];
int L[MAX];
int R[MAX];
int N[MAX];
int P[MAX];
stack<int> st;
int main() {
  int n, m, p;
  scanf("%d%d%d", &n, &m, &p);
  p--;
  scanf("%s", ch);
  s = ch;
  scanf("%s", ch);
  t = ch;
  for (int i = (0); i < (n); i++) {
    L[i] = i - 1;
    R[i] = i + 1;
  }
  st.push(0);
  for (int i = (1); i < (n); i++) {
    if (s[i] == '(') {
      st.push(i);
      continue;
    }
    int op = st.top();
    st.pop();
    N[op] = i;
    P[i] = op;
  }
  for (int i = (0); i < (m); i++) {
    if (t[i] == 'L') {
      p = L[p];
      continue;
    }
    if (t[i] == 'R') {
      p = R[p];
      continue;
    }
    if (s[p] == '(') {
      int cl = N[p];
      if (L[p] != -1) {
        R[L[p]] = R[cl];
      }
      if (R[cl] != n) {
        L[R[cl]] = L[p];
      }
      p = R[cl] == n ? L[p] : R[cl];
    } else {
      int op = P[p];
      if (L[op] != -1) {
        R[L[op]] = R[p];
      }
      if (R[p] != n) {
        L[R[p]] = L[op];
      }
      p = R[p] == n ? L[op] : R[p];
    }
  }
  while (L[p] != -1) p = L[p];
  while (p != n) {
    res += s[p];
    p = R[p];
  }
  printf("%s\n", res.c_str());
}
