#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int l[N], r[N], p[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m, pos;
  cin >> n >> m >> pos;
  string brack;
  cin >> brack;
  stack<int> St;
  for (int i = 0; i < n; i++)
    if (brack[i] == '(')
      St.push(i);
    else {
      p[St.top()] = i;
      p[i] = St.top();
      St.pop();
    }
  string s;
  cin >> s;
  pos--;
  for (int i = 0; i < n; i++) {
    l[i] = i - 1;
    r[i] = i + 1;
  }
  for (int i = 0; i < m; i++) {
    if (s[i] == 'L')
      pos = l[pos];
    else if (s[i] == 'R')
      pos = r[pos];
    else {
      if (pos > p[pos]) swap(pos, p[pos]);
      if (r[p[pos]] < n) l[r[p[pos]]] = l[pos];
      if (l[pos] >= 0) r[l[pos]] = r[p[pos]];
      pos = r[p[pos]] < n ? r[p[pos]] : l[pos];
    }
  }
  while (l[pos] >= 0) pos = l[pos];
  while (pos < n) {
    cout << brack[pos];
    pos = r[pos];
  }
  cout << endl;
  return 0;
}
