#include <bits/stdc++.h>
using namespace std;
int n, m, p, pr[500100];
bool us[500100];
char c;
vector<int> v;
set<int> st;
void solve() {
  for (int i = 0; i < m; ++i) {
    char key;
    cin >> key;
    if (key == 'L') p = *--st.lower_bound(p);
    if (key == 'R') p = *st.upper_bound(p);
    if (key == 'D') {
      int x = p, y = pr[p];
      if (x > y) swap(x, y);
      for (int i = x; i <= y; ++i) {
        if (us[i] && pr[i] > i) i = pr[i];
        us[i] = true;
        st.erase(i);
      }
      x = *st.upper_bound(p);
      p = (x == n ? *--st.lower_bound(p) : x);
    }
  }
  for (int i = 0; i < n; ++i)
    if (!us[i]) cout << (pr[i] > i ? '(' : ')');
}
int main() {
  cin >> n >> m >> p;
  for (int i = 0; i < n; ++i) {
    cin >> c;
    if (c == ')') {
      int x = v.back();
      v.erase(v.end() - 1);
      pr[i] = x;
      pr[x] = i;
    } else
      v.push_back(i);
  }
  st.insert(-1);
  st.insert(n);
  for (int i = 0; i < n; ++i) st.insert(i);
  --p;
  solve();
}
