#include <bits/stdc++.h>
using namespace std;
int left_[500003];
int right_[500003];
bool is_left[500003];
int match[500003];
int main() {
  int brackets, operations, pos;
  cin >> brackets >> operations >> pos;
  stack<int> s;
  char c;
  for (int i = 1; i <= brackets; i++) {
    cin >> c;
    if (c == '(') {
      is_left[i] = true;
      s.push(i);
    } else {
      is_left[i] = false;
      match[i] = s.top();
      match[s.top()] = i;
      s.pop();
    }
    left_[i] = i - 1;
    right_[i] = i + 1;
  }
  right_[0] = 1;
  int anterior, proximo, matching;
  for (int i = 0; i < operations; i++) {
    cin >> c;
    if (c == 'L') {
      pos = left_[pos];
    } else if (c == 'R') {
      pos = right_[pos];
    } else {
      if (!is_left[pos]) {
        pos = match[pos];
      }
      anterior = left_[pos];
      matching = match[pos];
      proximo = right_[matching];
      right_[anterior] = right_[matching];
      left_[proximo] = anterior;
      if (proximo != brackets + 1) {
        pos = proximo;
      } else {
        pos = anterior;
      }
    }
  }
  int j = right_[0];
  while (j != brackets + 1) {
    if (is_left[j]) {
      cout << '(';
    } else {
      cout << ')';
    }
    j = right_[j];
  }
  cout << "\n";
}
