#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
using namespace std;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int limit = 500000;
char s[limit + 10], op[limit + 10];
int nxt[limit + 10], prv[limit + 10], mov[limit + 10];
stack<int> stk;
int main(void) {
  int n, m, p;
  scanf("%d %d %d", &n, &m, &p);
  scanf("%s", s);
  scanf("%s", op);
  for (int i = int(0); i < int(n + 2); ++i) {
    nxt[i] = i + 1;
    prv[i] = i - 1;
  }
  for (int i = int(0); i < int(n); ++i) {
    if (s[i] == '(')
      stk.push(i + 1);
    else
      mov[stk.top()] = i + 1, mov[i + 1] = stk.top(), stk.pop();
  }
  for (int i = int(0); i < int(m); ++i) {
    if (op[i] == 'L') {
      p = prv[p];
      continue;
    }
    if (op[i] == 'R') {
      p = nxt[p];
      continue;
    }
    int left = p, right = mov[p];
    if (left > right) swap(left, right);
    left = prv[left], right = nxt[right];
    nxt[left] = right, prv[right] = left;
    p = right;
    if (p >= n + 1) p = left;
  }
  p = nxt[0];
  while (p <= n) {
    putchar(s[p - 1]);
    p = nxt[p];
  }
  puts("");
  return 0;
}
