#include <bits/stdc++.h>
using namespace std;
long long P[500010], R[500010], W[500010];
int main() {
  long long i, n, m, p, pos, current, j, x, previous;
  char s[500010], s1[500010];
  stack<long long> namira;
  scanf("%I64d%I64d%I64d", &n, &m, &p);
  scanf("%s", &s);
  scanf("%s", &s1);
  for (i = 0; i < n; i++) {
    if (s[i] == '(') {
      namira.push(i);
    } else {
      x = namira.top();
      P[i] = x;
      P[x] = i;
      namira.pop();
    }
  }
  current = p - 1;
  for (i = 0; i < m; i++) {
    if (s1[i] == 'L') {
      current--;
      pos = current;
      while (W[current] == -1) {
        P[pos] = P[current];
        P[P[current]] = pos;
        current = P[current] - 1;
      }
    } else if (s1[i] == 'R') {
      current++;
      pos = current;
      while (W[current] == -1) {
        P[pos] = P[current];
        P[P[current]] = pos;
        current = P[current] + 1;
      }
    } else {
      W[current] = -1;
      W[P[current]] = -1;
      previous = current;
      if (s[current] == ')') {
        current++;
        pos = current;
        while (W[current] == -1) {
          P[pos] = P[current];
          P[P[current]] = pos;
          current = P[current] + 1;
        }
        if (current >= n) {
          current = P[previous] - 1;
          pos = current;
          while (W[current] == -1) {
            P[pos] = P[current];
            P[P[current]] = pos;
            current = P[current] - 1;
          }
        }
      } else {
        current = P[current] + 1;
        pos = current;
        while (W[current] == -1) {
          P[pos] = P[current];
          P[P[current]] = pos;
          current = P[current] + 1;
        }
        if (current >= n) {
          current = previous - 1;
          pos = current;
          while (W[current] == -1) {
            P[pos] = P[current];
            P[P[current]] = pos;
            current = P[current] - 1;
          }
        }
      }
    }
  }
  for (i = 0; i < n;) {
    if (W[i] == -1) {
      i = P[i] + 1;
      continue;
    } else {
      printf("%c", s[i]);
      i++;
    }
  }
  return 0;
}
