#include <bits/stdc++.h>
using namespace std;
int flag[500007];
int myleft[500007];
int myright[500007];
int mypair[500007];
int n, m, p;
int cur;
void R(int& p) {
  if (myright[p] >= n) return;
  p = myright[p];
}
void L(int& p) {
  if (myleft[p] < 0) return;
  p = myleft[p];
}
void D(int& p) {
  if (mypair[p] > p) {
    for (int i = p; i <= mypair[p];) {
      flag[i] = 0;
      i = myright[i];
    }
    if (myleft[p] >= 0) myright[myleft[p]] = myright[mypair[p]];
    if (myright[mypair[p]] < n) myleft[myright[mypair[p]]] = myleft[p];
  } else {
    for (int i = p; i >= mypair[p];) {
      flag[i] = 0;
      i = myleft[i];
    }
    if (myright[p] < n) myleft[myright[p]] = myleft[mypair[p]];
    if (myleft[mypair[p]] >= 0) myright[myleft[mypair[p]]] = myright[p];
  }
  int temp = p;
  p = max(myright[p], myright[mypair[p]]);
  if (p == n) p = min(myleft[temp], myleft[mypair[temp]]);
}
int main() {
  cin >> n >> m >> p;
  string str, op;
  cin >> str;
  cin >> op;
  for (int i = 0; i < n; i++) {
    flag[i] = 1;
    myleft[i] = i - 1;
    myright[i] = i + 1;
    mypair[i] = i;
  }
  stack<int> stk;
  for (int i = 0; i < n; i++) {
    if (str[i] == '(')
      stk.push(i);
    else {
      mypair[stk.top()] = i;
      mypair[i] = stk.top();
      stk.pop();
    }
  }
  p--;
  for (int i = 0; i < m; i++) {
    if (op[i] == 'R')
      R(p);
    else if (op[i] == 'L')
      L(p);
    else if (op[i] == 'D')
      D(p);
  }
  for (int i = 0; i < n; i++)
    if (flag[i]) cout << str[i];
  cout << endl;
  return 0;
}
