#include <bits/stdc++.h>
using namespace std;
const int mx = 5e5 + 9;
int l[mx], r[mx], pos[mx];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  vector<int> v;
  int n, m, p;
  string s, t;
  cin >> n >> m >> p >> t >> s;
  p--;
  for (int i = 0; i < n; i++) {
    if (t[i] == '(')
      v.push_back(i);
    else
      pos[v.back()] = i, pos[i] = v.back(), v.pop_back();
    r[i] = i + 1, l[i] = i - 1;
  }
  r[-1] = 0;
  l[n] = n - 1;
  for (int i = 0; i < m; i++) {
    if (s[i] == 'R')
      p = r[p];
    else if (s[i] == 'L')
      p = l[p];
    else if (t[p] == '(')
      r[l[p]] = r[pos[p]], l[r[pos[p]]] = l[p], p = r[pos[p]];
    else
      l[r[p]] = l[pos[p]], r[l[pos[p]]] = r[p], p = r[p];
    if (p == n) p = l[n];
  }
  while (l[p] != -1) p = l[p];
  while (p != n) cout << t[p], p = r[p];
  cout << endl;
  return 0;
}
