#include <bits/stdc++.h>
using namespace std;
char s[500005], ord[500005];
stack<int> st;
int pr[500005], r[500005], l[500005];
int le[500005], ri[500005];
int main() {
  int i, j, k, m, n, p, cr, x, y;
  scanf("%d %d %d", &n, &m, &cr);
  scanf("%s", s);
  scanf("%s", ord);
  for (i = 0; i < n; i++) {
    if (s[i] == '(')
      st.push(i);
    else {
      x = st.top();
      pr[x] = i;
      pr[i] = x;
      st.pop();
    }
  }
  for (i = 0; i < n; i++) {
    r[i] = i + 1;
    l[i] = i - 1;
  }
  l[0] = n - 1;
  r[n - 1] = 0;
  cr--;
  for (i = 0; i < m; i++) {
    if (ord[i] == 'L')
      cr = l[cr];
    else if (ord[i] == 'R')
      cr = r[cr];
    else {
      x = cr;
      y = pr[cr];
      if (x > y) swap(x, y);
      if (r[y] < y)
        cr = l[x];
      else
        cr = r[y];
      le[x]++;
      ri[y]++;
      r[l[x]] = r[y];
      l[r[y]] = l[x];
    }
  }
  for (i = 0, m = 0; i < n; i++) {
    m += le[i];
    if (m == 0) {
      printf("%c", s[i]);
    }
    m -= ri[i];
  }
  printf("\n");
  return 0;
}
