#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, p;
  scanf("%d %d %d", &n, &m, &p);
  string s;
  cin >> s;
  string ord;
  cin >> ord;
  int sf[500010], sb[500010];
  int pr[500010];
  stack<int> St;
  sb[0] = 1;
  sf[n + 1] = n;
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == '(') {
      St.push(i);
    }
    if (s[i - 1] == ')') {
      pr[i] = St.top();
      pr[St.top()] = i;
      St.pop();
    }
    sf[i] = i - 1;
    sb[i] = i + 1;
  }
  for (int i = 0; i < m; i++) {
    if (ord[i] == 'R') p = sb[p];
    if (ord[i] == 'L') p = sf[p];
    if (ord[i] == 'D') {
      int frd = pr[p];
      if (frd < p) {
        sb[sf[frd]] = sb[p];
        sf[sb[p]] = sf[frd];
        if (sb[p] < n)
          p = sb[p];
        else
          p = sf[frd];
      } else {
        sf[sb[frd]] = sf[p];
        sb[sf[p]] = sb[frd];
        if (sb[frd] < n)
          p = sb[frd];
        else
          p = sf[p];
      }
    }
  }
  p = 0;
  while (sb[p] <= n) {
    p = sb[p];
    printf("%c", s[p - 1]);
  }
  printf("\n");
  return 0;
}
