#include <bits/stdc++.h>
const int N = 500010;
using namespace std;
char s[N], q[N];
int close[N];
set<int> has;
int main() {
  int n, m, p;
  scanf("%d %d %d", &n, &m, &p);
  scanf(" %s", s);
  scanf(" %s", q);
  has.insert(-1);
  has.insert(n);
  stack<int> open;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      open.push(i);
    } else {
      int j = open.top();
      open.pop();
      close[j] = i;
      close[i] = j;
    }
    has.insert(i);
  }
  p--;
  for (int x = 0; x < m; x++) {
    if (q[x] == 'L') {
      auto it = --has.lower_bound(p);
      p = max(*it, 0);
    } else if (q[x] == 'R') {
      auto it = has.upper_bound(p);
      p = min(*it, n - 1);
    } else {
      auto i = has.find(p);
      auto j = has.find(close[p]);
      if (*i > *j) {
        swap(i, j);
      }
      while (1) {
        if (i == j) {
          p = *i;
          has.erase(i);
          break;
        }
        auto k = i++;
        has.erase(k);
      }
      i = has.upper_bound(p);
      if (*i == n) {
        i = --has.lower_bound(p);
      }
      p = *i;
    }
  }
  for (int i = 0; i < n; i++) {
    if (has.count(i)) {
      putchar(s[i]);
    }
  }
  putchar('\n');
  return 0;
}
