#include <bits/stdc++.h>
using namespace std;
string s, op;
int twin[500500];
pair<int, int> side[500500];
bool deleted[500500];
int main() {
  ios::sync_with_stdio(false);
  int n, m, p;
  cin >> n >> m >> p;
  cin >> s >> op;
  stack<int> stk;
  stk.push(0);
  for (int i = 1; i < n; i++) {
    if (s[i] == '(') {
      stk.push(i);
    } else {
      twin[i] = stk.top();
      twin[stk.top()] = i;
      stk.pop();
    }
  }
  for (int i = 0; i < n; i++) {
    side[i].first = i - 1;
    side[i].second = i + 1;
  }
  memset(deleted, false, sizeof(deleted));
  p--;
  for (int i = 0; i < m; i++) {
    if (op[i] == 'R') {
      if (side[p].second != n) {
        p = side[p].second;
      }
    } else if (op[i] == 'L') {
      if (side[p].first != -1) {
        p = side[p].first;
      }
    } else {
      if (twin[p] < p) p = twin[p];
      for (int j = p; j <= twin[p]; j = side[j].second) {
        deleted[j] = true;
      }
      side[side[twin[p]].second].first = side[p].first;
      if (side[p].first != -1) {
        side[side[p].first].second = side[twin[p]].second;
      }
      if (side[twin[p]].second == n) {
        p = side[p].first;
      } else {
        p = side[twin[p]].second;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!deleted[i]) {
      cout << s[i];
    }
  }
  cout << endl;
  return 0;
}
