#include <bits/stdc++.h>
using namespace std;
char s[500100], op[500100];
int main() {
  int n, m, p;
  cin >> n >> m >> p;
  cin >> s + 1 >> op;
  s[0] = '(';
  s[n + 1] = ')';
  vector<int> prev(n + 2), next(n + 2), sib(n + 2), st;
  for (int i = 0; i < n + 2; i++) {
    prev[i] = i - 1;
    next[i] = i + 1;
    if (s[i] == '(')
      st.push_back(i);
    else {
      int j = st.back();
      st.pop_back();
      sib[i] = j;
      sib[j] = i;
    }
  }
  for (int i = 0; i < m; i++) {
    if (op[i] == 'R')
      p = next[p];
    else if (op[i] == 'L')
      p = prev[p];
    else {
      int a, b;
      if (s[p] == '(')
        a = prev[p], b = next[sib[p]];
      else
        a = prev[sib[p]], b = next[p];
      if (b != n + 1)
        p = b;
      else
        p = a;
      next[a] = b;
      prev[b] = a;
    }
  }
  for (int i = next[0]; i != n + 1; i = next[i]) cout << s[i];
  return 0;
}
