#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 51, MOD = 1e9 + 7;
const long double EPS = 0.000000001, PI = atan2(0, -1);
long long left1[N], right1[N], para[N];
bool used[N];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, p;
  cin >> n >> m >> p;
  p--;
  stack<long long> st;
  string s, s1;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '(')
      st.push(i);
    else {
      para[i] = st.top();
      para[st.top()] = i;
      st.pop();
    }
  }
  for (long long i = 1; i < n; i++) left1[i] = i - 1;
  left1[0] = -1;
  for (long long i = 0; i < n - 1; i++) {
    right1[i] = i + 1;
  }
  right1[n - 1] = -1;
  cin >> s1;
  for (long long i = 0; i < s1.size(); i++) {
    if (s1[i] == 'L') {
      p = left1[p];
    } else {
      if (s1[i] == 'R') {
        p = right1[p];
      } else {
        long long r, l;
        if (s[p] == ')') {
          r = p;
          l = para[p];
        } else {
          l = p;
          r = para[p];
        }
        if (right1[r] == -1) {
          r = left1[l];
          right1[r] = -1;
          p = r;
          continue;
        }
        if (left1[l] == -1) {
          l = right1[r];
          left1[l] = -1;
          p = l;
          continue;
        }
        l = left1[l];
        r = right1[r];
        right1[l] = r;
        left1[r] = l;
        p = r;
      }
    }
  }
  while (left1[p] != -1) p = left1[p];
  while (p != -1) {
    cout << s[p];
    p = right1[p];
  }
}
