#include <bits/stdc++.h>
char str[500005];
int left[500005], right[500005], pair[500005], stack[500005], snum;
int main() {
  int i, n, m, p;
  char x;
  scanf("%d %d %d", &n, &m, &p);
  for (i = 1; i <= n; i++) {
    scanf(" %c", &str[i]);
    if (str[i] == '(')
      stack[snum++] = i;
    else {
      pair[i] = stack[--snum];
      pair[stack[snum]] = i;
    }
  }
  for (i = 1; i <= n; i++) {
    left[i] = i - 1;
    right[i] = i + 1;
  }
  left[1] = -1;
  right[n] = -1;
  for (i = 1; i <= m; i++) {
    scanf(" %c", &x);
    if (x == 'R') {
      p = right[p];
    } else if (x == 'L') {
      p = left[p];
    } else {
      int mark = 0;
      if (str[p] == '(') {
        if (left[p] == -1) {
          left[right[pair[p]]] = -1;
        } else
          right[left[p]] = right[pair[p]];
        if (right[pair[p]] == -1) {
          right[left[p]] = -1;
          mark = 1;
        } else
          left[right[pair[p]]] = left[p];
        if (mark == 0)
          p = right[pair[p]];
        else
          p = left[p];
      } else {
        if (right[p] == -1) {
          right[left[pair[p]]] = -1;
          mark = 1;
        } else
          right[left[pair[p]]] = right[p];
        if (left[pair[p]] == -1)
          left[right[p]] = -1;
        else
          left[right[p]] = left[pair[p]];
        if (mark == 1)
          p = left[pair[p]];
        else
          p = right[p];
      }
    }
  }
  while (left[p] != -1) p = left[p];
  while (1) {
    printf("%c", str[p]);
    if (right[p] == -1) break;
    p = right[p];
  }
  return 0;
}
