#include <bits/stdc++.h>
using namespace std;
const long N = 500005;
pair<int, int> noi[N];
int vt[N];
int n;
string s;
void in(int x) {
  if (x > n) return;
  cout << s[x];
  in(noi[x].second);
}
int main() {
  int m, p;
  string o;
  cin >> n >> m >> p >> s >> o;
  s = " " + s;
  stack<int> q;
  for (int i = 1; i <= n; i++) {
    noi[i] = {i - 1, i + 1};
    if (q.empty()) {
      q.push(i);
      continue;
    }
    if (s[q.top()] == '(' && s[i] == ')') {
      vt[q.top()] = i;
      vt[i] = q.top();
      q.pop();
      continue;
    }
    q.push(i);
  }
  noi[0] = {-1, 1};
  noi[n + 1] = {n, n + 2};
  for (int i = 0; i < m; i++) {
    if (o[i] == 'R') {
      if (noi[p].second > n) continue;
      p = noi[p].second;
      continue;
    }
    if (o[i] == 'L') {
      if (noi[p].first == 0) continue;
      p = noi[p].first;
      continue;
    }
    if (s[p] == ')') {
      noi[noi[vt[p]].first].second = noi[p].second;
      noi[noi[p].second].first = noi[vt[p]].first;
      if (noi[p].second > n) {
        p = noi[vt[p]].first;
        continue;
      }
      p = noi[p].second;
      continue;
    }
    noi[noi[p].first].second = noi[vt[p]].second;
    noi[noi[vt[p]].second].first = noi[p].first;
    if (noi[vt[p]].second > n) {
      p = noi[p].first;
      continue;
    }
    p = noi[vt[p]].second;
    continue;
  }
  in(noi[0].second);
  return 0;
}
