#include <bits/stdc++.h>
using namespace std;
typedef struct {
  char c;
  int l, r, pr, st;
} it;
int main() {
  int n, m, p;
  cin >> n >> m >> p;
  vector<it> vr(n + 2);
  for (int i = 1; i <= n; i++) {
    cin >> vr[i].c;
    vr[i].l = i - 1;
    vr[i].r = i + 1;
  }
  stack<int> s;
  for (int i = 1; i <= n; i++) {
    if (vr[i].c == '(') {
      s.push(i);
    } else {
      int k = s.top();
      s.pop();
      vr[k].pr = i;
      vr[i].pr = k;
    }
  }
  for (int i = 0; i < m; i++) {
    char c;
    cin >> c;
    if (c == 'R') {
      p = vr[p].r;
    } else if (c == 'L') {
      p = vr[p].l;
    } else {
      int k = vr[p].pr;
      vr[p].st = 1;
      vr[k].st = 1;
      if (vr[p].c == '(') {
        vr[vr[p].l].r = vr[k].r;
        vr[vr[k].r].l = vr[p].l;
        if (vr[k].r != n + 1) {
          p = vr[k].r;
        } else {
          p = vr[p].l;
        }
      } else {
        vr[vr[k].l].r = vr[p].r;
        vr[vr[p].r].l = vr[k].l;
        if (vr[p].r != n + 1) {
          p = vr[p].r;
        } else {
          p = vr[k].l;
        }
      }
    }
  }
  int st = 0;
  for (int i = 1; i <= n; i++) {
    if (vr[i].st == 1) {
      if (vr[i].c == '(')
        st++;
      else
        st--;
      continue;
    }
    if (st != 0) {
      continue;
    }
    cout << vr[i].c;
  }
  cout << endl;
}
