#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, pos;
  string s, op;
  cin >> n >> m >> pos >> s >> op;
  vector<int> close(n + 2, -1);
  vector<int> st;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '(') {
      st.push_back(i + 1);
    } else {
      close[i + 1] = st.back();
      close[st.back()] = i + 1;
      st.pop_back();
    }
  }
  assert(st.empty());
  vector<int> left(n + 3, 0), right(n + 3, 0);
  for (int i = 0; i <= n + 1; ++i) left[i] = i;
  for (int i = 0; i <= n + 1; ++i) right[i] = i;
  for (char i : op) {
    if (i == 'D') {
      if (s[pos - 1] == '(') {
        right[pos] = right[close[pos] + 1];
        left[pos] = left[pos - 1];
        right[close[pos]] = right[close[pos] + 1];
        left[close[pos]] = left[pos - 1];
        pos = right[pos];
        while (right[pos] != pos && pos >= 1 && pos <= n) {
          right[pos] = right[right[pos]];
          pos = right[pos];
        }
        if (pos == n + 1) {
          pos--;
          pos = left[pos];
          while (left[pos] != pos && pos >= 1 && pos <= n) {
            left[pos] = left[left[pos]];
            pos = left[pos];
          }
        }
      } else {
        left[pos] = left[close[pos] - 1];
        right[pos] = right[pos + 1];
        left[close[pos]] = left[close[pos] - 1];
        right[close[pos]] = right[pos + 1];
        pos = right[pos];
        while (right[pos] != pos && pos >= 1 && pos <= n) {
          right[pos] = right[right[pos]];
          pos = right[pos];
        }
        if (pos == n + 1) {
          pos--;
          pos = left[pos];
          while (left[pos] != pos && pos >= 1 && pos <= n) {
            left[pos] = left[left[pos]];
            pos = left[pos];
          }
        }
      }
    } else if (i == 'R') {
      pos = right[pos + 1];
      while (right[pos] != pos && pos >= 1 && pos <= n) {
        right[pos] = right[right[pos]];
        pos = right[pos];
      }
    } else {
      pos = left[pos - 1];
      while (left[pos] != pos && pos >= 1 && pos <= n) {
        left[pos] = left[left[pos]];
        pos = left[pos];
      }
    }
  }
  string ans;
  int cur = right[1];
  while (cur <= n) {
    while (right[cur] != cur) cur = right[cur];
    if (cur - 1 < s.length()) ans += s[cur - 1];
    cur++;
  }
  cout << ans;
  return 0;
}
