#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > SortedSequences;
set<pair<int, int> > CurrentyIn;
set<pair<int, int> > CurrentyOut;
int paired[500001];
set<int> Removed;
bool vis[500001];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, p;
  cin >> n >> m >> p;
  string seq;
  cin >> seq;
  string operations;
  cin >> operations;
  stack<int> Indecies;
  for (int i = 0; i < n; i++) {
    if (seq[i] == '(')
      Indecies.push(i);
    else {
      int cur = Indecies.top();
      Indecies.pop();
      CurrentyIn.insert(make_pair(cur, i));
      SortedSequences.push_back(make_pair(cur, i));
      paired[i] = cur;
    }
    Removed.insert(i);
  }
  sort(SortedSequences.begin(), SortedSequences.end());
  p--;
  for (int i = 0; i < m; i++) {
    if (operations[i] == 'R') {
      p = *Removed.upper_bound(p);
    } else if (operations[i] == 'L') {
      set<int>::iterator it = Removed.lower_bound(p);
      it--;
      p = *it;
    } else {
      if (seq[p] == ')') p = paired[p];
      pair<int, int> todel = *CurrentyIn.lower_bound(make_pair(p, 0));
      int idx =
          lower_bound(SortedSequences.begin(), SortedSequences.end(), todel) -
          SortedSequences.begin();
      set<int>::iterator bug = Removed.lower_bound(todel.first);
      while (bug != Removed.end() && *bug <= todel.second) {
        set<int>::iterator tempcur = bug;
        bug++;
        Removed.erase(tempcur);
      }
      while (idx < SortedSequences.size() &&
             SortedSequences[idx].first <= todel.second) {
        if (CurrentyIn.count(SortedSequences[idx]))
          CurrentyIn.erase(CurrentyIn.find(SortedSequences[idx])),
              CurrentyOut.insert(SortedSequences[idx]);
        else
          break;
        idx++;
      }
      set<int>::iterator it = Removed.lower_bound(p);
      if (it == Removed.end()) it--;
      p = *it;
    }
  }
  bool b = false;
  while (CurrentyOut.size()) {
    pair<int, int> x = *CurrentyOut.begin();
    CurrentyOut.erase(CurrentyOut.begin());
    for (int i = x.first; i <= x.second && !vis[i]; i++) vis[i] = true;
  }
  for (int i = 0; i < n; i++)
    if (!vis[i]) cout << seq[i];
  cout << "\n";
  return 0;
}
