#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, m;
bool a[N];
int paired[N];
int nxtL[N], nxtR[N];
int update[N];
bool col[N];
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int p;
  cin >> n >> m >> p;
  for (int i = 1; i <= n; ++i) {
    char ch;
    cin >> ch;
    a[i] = (ch == ')');
  }
  stack<int> st;
  for (int i = 1; i <= n; ++i) {
    if (!a[i])
      st.push(i);
    else {
      int id = st.top();
      st.pop();
      paired[i] = id;
      paired[id] = i;
    }
  }
  for (int i = 0; i <= n + 1; ++i) {
    nxtL[i] = i - 1;
    nxtR[i] = i + 1;
  }
  int End = n;
  for (int i = 1; i <= m; ++i) {
    char ch;
    cin >> ch;
    if (ch == 'L')
      p = nxtL[p];
    else if (ch == 'R')
      p = nxtR[p];
    else {
      int L = p, R = paired[p];
      if (L > R) swap(L, R);
      col[L] = col[R] = 1;
      nxtL[nxtR[R]] = col[nxtL[L]] ? nxtL[nxtL[L]] : nxtL[L];
      nxtR[nxtL[L]] = col[nxtR[R]] ? nxtR[nxtR[R]] : nxtR[R];
      update[L] -= 1;
      update[R + 1] += 1;
      if (R == End)
        p = End = nxtL[L];
      else
        p = nxtR[R];
    }
  }
  for (int i = 1; i <= n; ++i) update[i] += update[i - 1];
  for (int i = 1; i <= n; ++i)
    if (update[i] >= 0) cout << (!a[i] ? '(' : ')');
  return 0;
}
