#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
const int INF = 1e9 + 7;
int nxt[N], par[N], bracket[N];
int n, m;
int del(int p, int find_pair) {
  nxt[par[find_pair]] = nxt[p];
  par[nxt[p]] = par[find_pair];
  if (nxt[p] > n) {
    return par[find_pair];
  } else
    return nxt[p];
}
void solve() {
  int p;
  cin >> n >> m >> p;
  string str;
  cin >> str;
  stack<int> v;
  for (int i = 1; i < N; i++) {
    par[i] = i - 1;
    nxt[i] = i + 1;
  }
  for (int i = 0; i < n; i++) {
    if (str[i] == '(') {
      v.push(i + 1);
    } else {
      bracket[v.top()] = i + 1;
      bracket[i + 1] = v.top();
      v.pop();
    }
  }
  string command;
  cin >> command;
  for (int i = 0; i < command.length(); i++) {
    if (command[i] == 'L') {
      p = par[p];
    } else if (command[i] == 'R') {
      p = nxt[p];
    } else {
      int find_pair = bracket[p];
      if (p > find_pair) {
        p = del(p, find_pair);
      } else {
        p = del(find_pair, p);
      }
    }
  }
  string str1 = "";
  int initP = p;
  while (initP >= 1) {
    str1.push_back(str[initP - 1]);
    initP = par[initP];
  }
  initP = nxt[p];
  reverse(str1.begin(), str1.end());
  while (initP <= n) {
    str1.push_back(str[initP - 1]);
    initP = nxt[initP];
  }
  cout << str1;
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
