#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, p;
  cin >> n >> m >> p;
  char cbs[n + 1], op[m];
  stack<int> positions;
  int pair[n], l[n + 1], r[n + 1];
  scanf("%s", cbs + 1);
  scanf("%s", op);
  cbs[0] = ' ';
  l[0] = -1;
  for (int i = 1; i <= n; i++) l[i] = i - 1;
  r[n] = -1;
  for (int i = 0; i < n; i++) r[i] = i + 1;
  for (int i = 1; i <= n; i++) {
    if (cbs[i] == '(')
      positions.push(i);
    else {
      pair[positions.top()] = i;
      pair[i] = positions.top();
      positions.pop();
    }
  }
  for (int i = 0; i < m; i++) {
    if (op[i] == 'R')
      p = r[p];
    else if (op[i] == 'L')
      p = l[p];
    else {
      if (cbs[p] == '(') {
        r[l[p]] = r[pair[p]];
        l[r[pair[p]]] = l[p];
        p = (r[pair[p]] != -1) ? r[pair[p]] : l[p];
      } else {
        l[r[p]] = l[pair[p]];
        r[l[pair[p]]] = r[p];
        p = (r[p] != -1) ? r[p] : l[pair[p]];
      }
    }
  }
  int x = r[0];
  while (x != -1) {
    printf("%c", cbs[x]);
    x = r[x];
  }
  printf("\n");
  return 0;
}
