#include <bits/stdc++.h>
using namespace std;
long long int range[1000006][2];
long long int pos[1000002];
int main() {
  long long int n, i, x, y, z, t, j, m, k, p;
  cin >> n >> m >> p;
  char br[1000002];
  char op[1000002];
  scanf("%s", br);
  scanf("%s", op);
  string bracket = br;
  string sig = op;
  set<long long int> myset;
  std::set<long long int>::iterator it, git, tit;
  stack<long long int> mystack;
  for (int i = 0; i < bracket.length(); i++) {
    if (bracket[i] == '(')
      mystack.push(i + 1);
    else {
      long long int t = mystack.top();
      mystack.pop();
      range[t][0] = t;
      range[t][1] = i + 1;
      range[i + 1][0] = t;
      range[i + 1][1] = i + 1;
    }
  }
  for (int i = 0; i < bracket.size(); i++) {
    if (bracket[i] == '(') {
      pos[i + 1] = 1;
    } else {
      pos[i + 1] = 2;
    }
    myset.insert(i + 1);
  }
  it = myset.begin();
  for (int i = 1; i < p; i++) {
    it++;
  }
  for (int i = 0; i < sig.size(); i++) {
    if (sig[i] == 'R') {
      it++;
    } else if (sig[i] == 'L') {
      it--;
    } else {
      long long int val = *it;
      if (pos[val] == 1) {
        y = range[val][1];
        while (*it <= y) {
          tit = it;
          tit++;
          if (tit == myset.end()) {
            myset.erase(it);
            it = myset.end();
            it--;
            break;
          } else {
            myset.erase(it);
            it = tit;
          }
        }
      } else {
        x = range[val][0];
        git = it;
        git++;
        int flag = 0;
        if (git == myset.end()) flag = 1;
        while (*it >= x) {
          tit = it;
          if (tit == myset.begin()) {
            myset.erase(it);
            git = myset.begin();
            break;
          } else {
            tit--;
            myset.erase(it);
            it = tit;
          }
        }
        if (flag == 1) {
          it = myset.end();
          it--;
        } else
          it = git;
      }
    }
  }
  for (it = myset.begin(); it != myset.end(); ++it) {
    long long int t = *it;
    if (pos[t] == 1)
      printf("(");
    else
      printf(")");
  }
}
