#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9, PI = acos(-1.);
const long long LINF = 0x3f3f3f3f3f3f3f3f, LMOD = 1011112131415161719ll;
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;
const int N = 5e5 + 5;
int l[N], r[N], oppo[N];
int n, m, p;
char s[N], c;
stack<int> stk;
int main() {
  scanf("%d%d%d", &n, &m, &p);
  scanf(" %s", s + 1);
  for (int i = 0; i < n; i++) r[i] = i + 1;
  for (int i = 1; i <= n; i++) l[i] = i - 1;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(')
      stk.push(i);
    else {
      int t = stk.top();
      stk.pop();
      oppo[i] = t;
      oppo[t] = i;
    }
  }
  while (m--) {
    scanf(" %c", &c);
    if (c == 'R')
      p = r[p];
    else if (c == 'L')
      p = l[p];
    else {
      int i = p;
      int j = oppo[p];
      if (i > j) swap(i, j);
      int li = l[i];
      int rj = p = r[j];
      r[li] = rj;
      if (rj) l[rj] = li;
      if (!p) p = li;
    }
  }
  p = r[0];
  while (p) {
    printf("%c", s[p]);
    p = r[p];
  }
  printf("\n");
  return 0;
}
