#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932384626433832795;
inline int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
inline int ri() {
  int ret = 0;
  scanf("%d", &ret);
  return ret;
};
inline double rd() {
  double ret = 0;
  scanf("%lf", &ret);
  return ret;
};
inline void prln() { printf("\n"); }
inline void prln(int nn) { printf("%d\n", nn); }
const int NN = 500005;
char ss[NN];
char cmds[NN];
int _prev[NN];
int _next[NN];
int _pair[NN];
int n, m;
void make_pairs() {
  stack<int> st;
  for (int ii = 0; ii < n; ii++) {
    if (ss[ii] == '(')
      st.push(ii);
    else {
      int kk = st.top();
      st.pop();
      _pair[ii + 1] = kk + 1;
      _pair[kk + 1] = ii + 1;
    }
  }
}
int main() {
  n = ri();
  m = ri();
  int p = ri();
  scanf("%s\n", ss);
  scanf("%s\n", cmds);
  for (int ii = 0; ii < n + 1; ii++) {
    _prev[ii] = ii - 1;
    _next[ii] = ii + 1;
  }
  make_pairs();
  for (int ii = 0; ii < m; ii++) {
    int op = cmds[ii];
    if (op == 'L')
      p = _prev[p];
    else if (op == 'R')
      p = _next[p];
    else if (op == 'D') {
      int b1 = p;
      int b2 = _pair[b1];
      if (b1 > b2) swap(b1, b2);
      _next[_prev[b1]] = _next[b2];
      _prev[_next[b2]] = _prev[b1];
      p = _next[b2];
      if (p > n) p = _prev[p];
    }
  }
  p = 0;
  while (1) {
    p = _next[p];
    if (p > n) break;
    char c = ss[p - 1];
    printf("%c", c);
  }
  prln();
  return 0;
}
