#include <bits/stdc++.h>
using namespace std;
const int maxn = 500005;
int n, m, p, tval;
string str;
stack<int> stk;
int a[maxn], pre[maxn], lc[maxn], rc[maxn], nxt[maxn], vis[maxn];
int find(int x) {
  int ri = x;
  while (pre[ri] != ri) ri = pre[ri];
  int i = x, j;
  while (i != ri) {
    j = pre[i];
    pre[i] = ri;
    i = j;
  }
  return ri;
}
void join(int x, int y) {
  int fx = find(x), fy = find(y);
  if (fx != fy) pre[fx] = fy;
}
int main() {
  cin >> n >> m >> p >> str;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == ')') {
      a[i + 1] = 1;
      int val = stk.top();
      stk.pop();
      lc[i + 1] = lc[val] = val;
      rc[val] = rc[i + 1] = i + 1;
    } else
      stk.push(i + 1);
  }
  for (int i = 0; i <= n; i++) {
    nxt[i] = i + 1;
    pre[i] = i;
  }
  while (m--) {
    char ch;
    cin >> ch;
    if (ch == 'L')
      p = find(p - 1);
    else if (ch == 'R')
      p = nxt[p];
    else {
      int fa = find(lc[p] - 1);
      pre[lc[p]] = pre[rc[p]] = fa;
      vis[lc[p]] = vis[rc[p]] = 1;
      while (vis[p]) p = nxt[rc[p]];
      nxt[fa] = p;
      if (p > n) {
        p = fa;
        nxt[fa] = n + 1;
      }
    }
  }
  for (int i = nxt[0]; i <= n; i = nxt[i]) {
    if (!vis[i]) cout << str[i - 1];
  }
  return 0;
}
