#include <bits/stdc++.h>
using namespace std;
template <class t>
t lcm(t a, t b) {
  return ((a * b) / __gcd(a, b));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, pos, q;
  string ss, s;
  cin >> n >> q >> pos;
  long long l[n], r[n], match[n], init = 0;
  stack<long long> st;
  cin >> ss;
  pos--;
  for (long long i = 0; i < n; i++) {
    if (ss[i] == '(')
      st.push(i);
    else {
      match[i] = st.top();
      match[st.top()] = i;
      st.pop();
    }
    l[i] = i - 1;
    r[i] = i + 1;
  }
  cin >> s;
  for (long long i = 0; i < q; i++) {
    if (s[i] == 'L')
      pos = l[pos];
    else if (s[i] == 'R')
      pos = r[pos];
    else {
      long long ldel = min(pos, match[pos]), rdel = max(pos, match[pos]);
      if (ldel == init) init = r[rdel];
      if (r[rdel] < n) {
        l[r[rdel]] = l[ldel];
        pos = r[rdel];
      } else
        pos = l[ldel];
      if (l[ldel] >= 0) {
        r[l[ldel]] = r[rdel];
      }
    }
  }
  pos = init;
  while (pos < n) {
    cout << ss[pos];
    pos = r[pos];
  }
  return 0;
}
