#include <bits/stdc++.h>
int take() {
  int n;
  scanf("%d", &n);
  return n;
}
double ttake() {
  double n;
  scanf("%lf", &n);
  return n;
}
long long takes() {
  long long n;
  scanf("%lld", &n);
  return n;
}
int cas;
using namespace std;
bool approximatelyEqual(float a, float b, float epsilon) {
  return fabs(a - b) <= ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool essentiallyEqual(float a, float b, float epsilon) {
  return fabs(a - b) <= ((fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool definitelyGreaterThan(float a, float b, float epsilon) {
  return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
bool definitelyLessThan(float a, float b, float epsilon) {
  return (b - a) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
struct info {
  int nearEst;
  int furthest;
} tr[4 * 500005];
bool lazy[4 * 500005];
void built(int s, int e, int n) {
  if (s > e) return;
  if (s == e) {
    tr[n] = {s, s};
    return;
  }
  int m = s + (e - s) / 2;
  built(s, m, 2 * n);
  built(m + 1, e, 2 * n + 1);
  tr[n].nearEst = tr[2 * n].nearEst ? tr[2 * n].nearEst : tr[2 * n + 1].nearEst;
  tr[n].furthest =
      tr[2 * n + 1].furthest ? tr[2 * n + 1].furthest : tr[2 * n].furthest;
}
void update(int s, int e, int l, int r, int n) {
  if (lazy[n]) {
    tr[n].nearEst = 0;
    tr[n].furthest = 0;
    if (s != e) {
      lazy[2 * n] = 1;
      lazy[2 * n + 1] = 1;
    }
    lazy[n] = 0;
  }
  if (s > e || s > r || e < l) return;
  if (s >= l && e <= r) {
    tr[n].nearEst = 0;
    tr[n].furthest = 0;
    if (s != e) {
      lazy[2 * n] = 1;
      lazy[2 * n + 1] = 1;
    }
    return;
  }
  int m = s + (e - s) / 2;
  update(s, m, l, r, 2 * n);
  update(m + 1, e, l, r, 2 * n + 1);
  tr[n].nearEst = tr[2 * n].nearEst ? tr[2 * n].nearEst : tr[2 * n + 1].nearEst;
  tr[n].furthest =
      tr[2 * n + 1].furthest ? tr[2 * n + 1].furthest : tr[2 * n].furthest;
}
info query(int s, int e, int l, int r, int n) {
  if (lazy[n]) {
    tr[n].nearEst = 0;
    tr[n].furthest = 0;
    if (s != e) {
      lazy[2 * n] = 1;
      lazy[2 * n + 1] = 1;
    }
    lazy[n] = 0;
  }
  if (s > e || s > r || e < l) return tr[0];
  if (s >= l && e <= r) {
    return tr[n];
  }
  int m = s + (e - s) / 2;
  info p = query(s, m, l, r, 2 * n);
  info q = query(m + 1, e, l, r, 2 * n + 1);
  info ans = {0, 0};
  if (p.nearEst)
    ans.nearEst = p.nearEst;
  else if (q.nearEst)
    ans.nearEst = q.nearEst;
  if (q.furthest)
    ans.furthest = q.furthest;
  else if (p.furthest)
    ans.furthest = p.furthest;
  return ans;
}
int main() {
  int tc = 1;
  tr[0] = {0, 0};
  while (tc--) {
    int n = take(), m = take(), now = take();
    pair<int, int> pos[n + 1];
    string s, change;
    cin >> s >> change;
    stack<int> stk;
    for (int i = 0; i <= n - 1; i += 1) {
      if (stk.empty() || s[i] == '(')
        stk.push(i + 1);
      else {
        if (stk.empty())
          pos[i + 1] = make_pair(i + 1, i + 1);
        else {
          pos[i + 1] = make_pair(stk.top(), i + 1);
          pos[stk.top()] = make_pair(stk.top(), i + 1);
          stk.pop();
        }
      }
    }
    while (!stk.empty()) {
      pos[stk.top()] = make_pair(stk.top(), stk.top());
      stk.pop();
    }
    built(1, n, 1);
    for (int i = 0; i <= change.size() - 1; i += 1) {
      if (change[i] == 'R') {
        now = query(1, n, now + 1, n, 1).nearEst;
      } else if (change[i] == 'L') {
        now = query(1, n, 1, now - 1, 1).furthest;
      } else {
        update(1, n, pos[now].first, pos[now].second, 1);
        int id = query(1, n, now + 1, n, 1).nearEst;
        if (!id) {
          id = query(1, n, 1, now - 1, 1).furthest;
        }
        now = id;
      }
    }
    for (int i = 1; i <= n; i += 1) {
      if (query(1, n, i, i, 1).nearEst) {
        cout << s[i - 1];
      }
    }
  }
  { return 0; };
}
