#include <bits/stdc++.h>
using namespace std;
const long long int N = 5e5 + 1;
const long long int inf = 1e15;
const long long int M = 1e9 + 7;
long long int n, m, p, pos[N], l[N], r[N];
string s, q;
void solve() {
  memset(pos, -1, sizeof pos);
  cin >> n >> m >> p >> s >> q;
  s = '#' + s;
  stack<long long int> st;
  for (long long int i = 1; i <= n; i++) {
    if (s[i] == '(')
      st.push(i);
    else {
      long long int x = st.top();
      st.pop();
      pos[x] = i;
      pos[i] = x;
    }
  }
  for (long long int i = 1; i <= n; i++) l[i] = i - 1, r[i] = i + 1;
  r[0] = 1, l[n + 1] = n;
  for (long long int i = 0; i < m; i++) {
    char o = q[i];
    if (o == 'D') {
      long long int L = p, R = pos[p];
      if (L > R) swap(L, R);
      l[r[R]] = l[L];
      r[l[L]] = r[R];
      p = r[R];
    }
    if (o == 'R') p = r[p];
    if (o == 'L') p = l[p];
    if (p > n) p = l[p];
    if (p < 1) p = r[0];
  }
  while (l[p]) p = l[p];
  for (long long int i = p; i <= n; i = r[i]) {
    cout << s[i];
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve(), cout << "\n";
  long long int x = 0;
  return 0;
}
