#include <bits/stdc++.h>
double eps = 1e-9;
using namespace std;
int arr[500002];
int deleted[500002];
int main() {
  std::ios::sync_with_stdio(false);
  int n, m, p;
  cin >> n >> m >> p;
  string s, cm;
  cin >> s >> cm;
  stack<pair<char, int> > sta;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      sta.push(make_pair('(', i));
    } else {
      pair<char, int> tp = sta.top();
      sta.pop();
      arr[i + 1] = tp.second + 1;
      arr[tp.second + 1] = i + 1;
    }
  }
  for (int i = 0; i < m; i++) {
    if (cm[i] == 'R') {
      if (deleted[p + 1]) {
        p = arr[p + 1] + 1;
      } else {
        p++;
      }
    } else if (cm[i] == 'L') {
      if (deleted[p - 1]) {
        p = arr[p - 1] - 1;
      } else {
        p--;
      }
    } else {
      int lm, rm;
      if (s[p - 1] == '(') {
        if (deleted[p - 1]) {
          lm = arr[p - 1];
        } else {
          lm = p;
        }
        if (deleted[arr[p] + 1]) {
          rm = arr[arr[p] + 1];
        } else {
          rm = arr[p];
        }
      } else {
        if (deleted[p + 1]) {
          rm = arr[p + 1];
        } else {
          rm = p;
        }
        if (deleted[arr[p] - 1]) {
          lm = arr[arr[p] - 1];
        } else {
          lm = arr[p];
        }
      }
      arr[lm] = rm;
      arr[rm] = lm;
      deleted[lm] = 1;
      deleted[rm] = 1;
      if (rm == n) {
        p = lm - 1;
      } else {
        p = rm + 1;
      }
    }
  }
  int i = 1;
  while (i <= n) {
    if (deleted[i]) {
      i = arr[i] + 1;
    } else {
      cout << s[i - 1];
      i++;
    }
  }
  return 0;
}
