#include <bits/stdc++.h>
using namespace std;
int n, m, p, len;
int pos[500020];
int Left[500020];
int Right[500020];
string str;
void Work() {
  int t = p;
  char op;
  int rt;
  for (int i = 0; i < m; i++) {
    cin >> op;
    if (op == 'L')
      p = Left[p];
    else if (op == 'R')
      p = Right[p];
    else {
      rt = pos[p];
      if (rt > p) swap(rt, p);
      Right[Left[rt]] = Right[p];
      Left[Right[p]] = Left[rt];
      if (Right[p] > len)
        p = Left[rt];
      else
        p = Right[p];
    }
  }
  for (int i = 0; i <= len;) {
    if (i) cout << str[i - 1];
    i = Right[i];
  }
  cout << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  while (cin >> n >> m >> p) {
    stack<int> s;
    cin >> str;
    len = str.size();
    Right[0] = 1;
    Left[1] = 0;
    Right[len] = len + 1;
    Left[len + 1] = len;
    for (int i = 1; i <= len; i++) {
      Right[i] = i + 1;
      Left[i] = i - 1;
      if (str[i - 1] == '(')
        s.push(i);
      else {
        pos[i] = s.top();
        pos[s.top()] = i;
        s.pop();
      }
    }
    Work();
  }
  return 0;
}
