#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
struct Bracket {
  int type;
  Bracket *left, *right;
};
char s[500005];
int main() {
  int n, m, p, i, cnt, dir;
  scanf("%d %d %d", &n, &m, &p);
  Bracket *head = new Bracket(), *tail = new Bracket(), *cur, *pos, *temp;
  head->left = head->right = NULL;
  scanf("%s", s);
  cur = head;
  for (i = 0; i < n; i++) {
    cur->right = new Bracket();
    cur->right->type = (s[i] == '(' ? 0 : 1);
    cur->right->left = cur;
    cur = cur->right;
    if (i == p - 1) pos = cur;
  }
  cur->right = tail;
  tail->left = cur;
  tail->right = NULL;
  scanf("%s", s);
  for (i = 0; i < m; i++) {
    if (s[i] == 'R')
      pos = pos->right;
    else if (s[i] == 'L')
      pos = pos->left;
    else {
      if (pos->type == 0)
        cnt = 1;
      else
        cnt = -1;
      dir = cnt;
      pos->left->right = pos->right;
      pos->right->left = pos->left;
      if (dir == 1)
        pos = pos->right;
      else
        pos = pos->left;
      while (cnt != 0) {
        if (pos->type == 0)
          cnt += 1;
        else
          cnt += -1;
        pos->left->right = pos->right;
        pos->right->left = pos->left;
        if (dir == 1)
          pos = pos->right;
        else
          pos = pos->left;
      }
      if (dir == -1) pos = pos->right;
      if (pos == tail) pos = pos->left;
    }
  }
  cur = head->right;
  i = 0;
  while (cur != tail) {
    if (cur->type == 0)
      s[i] = '(';
    else
      s[i] = ')';
    i++;
    cur = cur->right;
  }
  s[i] = '\0';
  printf("%s\n", s);
  return 0;
}
