#include <bits/stdc++.h>
using namespace std;
int n, m, p, saath[500005], pos[500005];
char br[500005], co[500005];
void findpair() {
  stack<int> left, right;
  pos[n + 1] = n + 1;
  for (int i = 1; i <= n; i++) {
    if (br[i] == '(')
      left.push(i);
    else {
      int a = left.top();
      left.pop();
      saath[i] = a;
      saath[a] = i;
    }
    pos[i] = i;
  }
}
int move(int pp) {
  if (pos[pp] == pp) return pp;
  return pos[pp] = move(pos[pp]);
}
int main() {
  scanf("%d %d %d", &n, &m, &p);
  scanf("%s", br + 1);
  scanf("%s", co);
  findpair();
  for (int i = 0; i < m; i++) {
    if (co[i] == 'R')
      p = move(p + 1);
    else if (co[i] == 'L')
      p = move(p - 1);
    else {
      if (br[p] == '(') {
        pos[p] = pos[saath[p]] + 1;
        pos[saath[p]] = p - 1;
        if (move(pos[p]) == n + 1)
          p = move(pos[saath[p]]);
        else
          p = move(pos[p]);
      } else {
        pos[p] = pos[saath[p]] - 1;
        pos[saath[p]] = p + 1;
        if (move(pos[saath[p]]) == n + 1)
          p = move(pos[p]);
        else {
          p = move(pos[saath[p]]);
        }
      }
    }
  }
  for (int i = move(1); i <= n; i = move(i + 1)) printf("%c", br[i]);
  return 0;
}
