#include <bits/stdc++.h>
using namespace std;
int n, m, p, l[500015 + 2], r[500015 + 2], nex[500015 + 2], bac[500015 + 2];
char s[500015 + 2];
char ss[500015 + 2];
void Make() {
  int i, j;
  stack<int> Stk;
  for (i = 1; i <= n; i++) {
    if (s[i] == '(') {
      Stk.push(i);
    } else {
      if (Stk.size()) {
        int tp = Stk.top();
        Stk.pop();
        l[i] = tp;
        r[tp] = i;
      }
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &p);
  scanf("%s", s + 1);
  Make();
  for (int i = 0; i <= n + 1; i++) nex[i] = i + 1;
  for (int i = 0; i <= n + 1; i++) bac[i] = i - 1;
  scanf("%s", ss);
  int q = strlen(ss);
  for (int i = 0; i <= q - 1; i++) {
    if (ss[i] == 'R') {
      p = nex[p];
    } else if (ss[i] == 'L') {
      p = bac[p];
    } else {
      if (s[p] == '(') {
        int nx = r[p];
        nex[bac[p]] = nex[nx];
        bac[nex[nx]] = bac[p];
        if (nex[nx] <= n) {
          p = nex[nx];
        } else {
          p = bac[p];
        }
      } else if (s[p] == ')') {
        int nx = l[p];
        bac[nex[p]] = bac[nx];
        nex[bac[nx]] = nex[p];
        if (nex[p] <= n) {
          p = nex[p];
        } else {
          p = bac[nx];
        }
      }
    }
  }
  p = nex[0];
  while (true) {
    printf("%c", s[p]);
    p = nex[p];
    if (p > n) break;
  }
  printf("\n");
  return 0;
}
