#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, m, pos, now;
char ch[500005];
char str[500005];
int a[500005];
int p[500005];
class node {
 public:
  int l, r;
} e[500005];
int main() {
  n = read(), m = read(), pos = read();
  scanf("%s", ch + 1);
  scanf("%s", str + 1);
  for (int i = 0; i <= n + 1; i++) e[i].l = i - 1, e[i].r = i + 1;
  for (int i = 1; i <= n; i++) {
    if (ch[i] == '(')
      a[++now] = i;
    else {
      p[i] = a[now--];
      p[a[now + 1]] = i;
    }
  }
  for (int i = 1; i <= m; i++) {
    if (str[i] == 'R')
      pos = e[pos].r;
    else if (str[i] == 'L')
      pos = e[pos].l;
    else {
      static int l, r;
      l = p[pos];
      r = p[p[pos]];
      if (l > r) swap(l, r);
      e[e[l].l].r = e[r].r;
      e[e[r].r].l = e[l].l;
      pos = e[r].r;
      if (pos == n + 1) pos = e[n + 1].l;
      if (!pos) pos = e[0].r;
    }
  }
  pos = e[0].r;
  while (pos != n + 1) {
    printf("%c", ch[pos]);
    pos = e[pos].r;
  }
  return 0;
}
