#include <bits/stdc++.h>
using namespace std;
struct stu {
  int zhi;
  int next;
  int from;
  int pei;
};
stu a[500005];
stack<int> st;
char s[500005];
char pl[500005];
int main() {
  int n, m, p;
  scanf("%d%d%d", &n, &m, &p);
  cin >> pl;
  a[0].next = 1;
  a[n].from = n - 1;
  for (int i = 1; i <= n; i++) {
    a[i].next = i + 1;
    a[i].from = i - 1;
    if (pl[i - 1] == '(') {
      a[i].zhi = -1;
      st.push(i);
    } else {
      a[i].zhi = 1;
      a[i].pei = st.top();
      a[st.top()].pei = i;
      st.pop();
    }
  }
  cin >> s;
  int kl;
  kl = p;
  int len;
  len = strlen(s);
  for (int i = 0; i < len; i++) {
    if (s[i] == 'L') {
      kl = a[kl].from;
    }
    if (s[i] == 'R') {
      kl = a[kl].next;
    }
    if (s[i] == 'D') {
      int zj, pd;
      zj = min(a[kl].pei, kl);
      pd = max(a[kl].pei, kl);
      a[a[zj].from].next = a[pd].next;
      a[a[pd].next].from = a[zj].from;
      if (a[pd].next == n + 1) {
        kl = a[zj].from;
      } else {
        kl = a[pd].next;
      }
    }
  }
  int j = a[0].next;
  while (j < n + 1) {
    if (a[j].zhi == -1) {
      printf("(");
    } else {
      printf(")");
    }
    j = a[j].next;
  }
}
