#include <bits/stdc++.h>
const int maxn = 5e5 + 10;
int next[maxn], prev[maxn];
int pair[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  int n, m, p;
  std::cin >> n >> m >> p;
  std::stack<int> s;
  std::string in, com;
  std::cin >> in;
  std::cin >> com;
  for (int i = 0; i < n; i++) prev[i] = i - 1, next[i] = i + 1;
  for (int i = 0; i < n; i++) {
    if (in[i] == '(')
      s.push(i);
    else {
      int top = s.top();
      s.pop();
      pair[top] = i;
      pair[i] = top;
    }
  }
  p--;
  for (int c = 0; c < m; c++) {
    if (com[c] == 'R')
      p = next[p];
    else if (com[c] == 'L')
      p = prev[p];
    else {
      int end = pair[p];
      int r = std::max(end, p);
      int l = std::min(end, p);
      if (prev[l] == -1) {
        p = next[r];
        prev[p] = -1;
      } else {
        if (next[r] == n) {
          next[prev[l]] = n;
          p = prev[l];
        } else {
          next[prev[l]] = next[r];
          prev[next[r]] = prev[l];
          p = next[r];
        }
      }
    }
  }
  while (prev[p] != -1) {
    p = prev[p];
  }
  while (p != n) {
    std::cout << in[p];
    p = next[p];
  }
  std::cout << std::endl;
  return 0;
}
