#include <bits/stdc++.h>
using namespace std;
int n, m, p;
stack<int> sta;
int match[500050], L[500050], R[500050];
char s[500050];
int main() {
  scanf("%d %d %d", &n, &m, &p);
  scanf(" %s", s + 1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      sta.push(i);
    else if (s[i] == ')') {
      match[i] = sta.top();
      match[sta.top()] = i;
      sta.pop();
    }
    R[i] = i + 1;
    L[i] = i - 1;
  }
  R[0] = 1;
  while (m--) {
    char op;
    scanf(" %c", &op);
    if (op == 'R')
      p = R[p];
    else if (op == 'L')
      p = L[p];
    else {
      if (match[p] > p) {
        R[L[p]] = R[match[p]];
        L[R[match[p]]] = L[p];
        p = R[match[p]];
        if (p > n) p = L[p];
      } else {
        R[L[match[p]]] = R[p];
        L[R[p]] = L[match[p]];
        p = R[p];
        if (p > n) p = L[p];
      }
    }
  }
  int pos = R[0];
  while (pos <= n) {
    printf("%c", s[pos]);
    pos = R[pos];
  }
  puts("");
}
