#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, p;
  cin >> n >> m >> p;
  p--;
  string s;
  cin >> s;
  string op;
  cin >> op;
  vector<int> l(n + 1), r(n + 1), d(n + 1);
  for (int i = 0; i <= n; i++) l[i] = i - 1, r[i] = i + 1;
  stack<int> st;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(')
      st.push(i);
    else {
      int pos = st.top();
      st.pop();
      d[pos] = i;
      d[i] = pos;
    }
  }
  l[0] = n;
  r[n] = 0;
  for (char c : op) {
    if (c == 'R') {
      p = r[p];
    } else if (c == 'L') {
      p = l[p];
    } else {
      int pos = d[p];
      if (pos > p) swap(pos, p);
      l[r[p]] = l[pos];
      r[l[pos]] = r[p];
      p = r[p];
      if (p == n) p = l[p];
    }
  }
  p = n;
  while (true) {
    p = r[p];
    if (p == n) break;
    cout << s[p];
  }
  return 0;
}
