#include <bits/stdc++.h>
using namespace std;
stack<pair<char, int> > S;
int A[1 << 21], L[1 << 21], R[1 << 21];
string s1;
int main() {
  int n, m, p;
  scanf("%d %d %d", &n, &m, &p);
  cin >> s1;
  s1 = '#' + s1;
  for (int i = 1; i <= n; i++) {
    if (S.empty() || s1[i] == '(') {
      S.push(make_pair(s1[i], i));
      continue;
    }
    if (S.top().first == '(') {
      A[i] = S.top().second;
      A[S.top().second] = i;
      S.pop();
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      L[i] = -1;
      R[i] = i + 1;
    } else if (i == n) {
      L[i] == n - 1;
      R[i] = -1;
    } else {
      L[i] = i - 1;
      R[i] = i + 1;
    }
  }
  L[n] = n - 1;
  R[n] = -1;
  string Q;
  cin >> Q;
  int curr = p;
  for (int i = 0; i < Q.size(); i++) {
    if (Q[i] == 'L') {
      int a = L[curr];
      if (a == -1) continue;
      curr = L[curr];
    } else if (Q[i] == 'R') {
      int a = R[curr];
      if (a == -1) continue;
      curr = R[curr];
    } else {
      int i1 = min(A[curr], curr);
      int i2 = max(curr, A[curr]);
      if (R[i2] == -1) {
        R[L[i1]] = -1;
      } else if (L[i1] == -1) {
        L[R[i2]] = -1;
      } else {
        int xx = L[i1];
        int yy = R[i2];
        R[xx] = yy;
        L[yy] = xx;
      }
      if (R[i2] == -1)
        curr = L[i1];
      else
        curr = R[i2];
    }
  }
  int index1;
  for (int i = 1; i <= n; i++) {
    if (L[i] == -1) index1 = i;
  }
  curr = index1;
  while (1) {
    cout << s1[curr];
    curr = R[curr];
    if (curr == -1) break;
  }
  return 0;
}
