#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, uk;
  cin >> n >> m >> uk;
  uk--;
  string s;
  cin >> s;
  string t;
  set<pair<int, int> > st;
  cin >> t;
  int l[n], r[n];
  for (int i = 0; i < n; i++) {
    if (i != 0 && i != n - 1) {
      l[i] = i - 1;
      r[i] = i + 1;
    }
    if (i == 0) {
      l[i] = -1;
      r[i] = i + 1;
    }
    if (i == n - 1) {
      l[i] = i - 1;
      r[i] = -1;
    }
  }
  int p[n];
  deque<int> q;
  for (int i = 0; i < s.size(); i++) {
    int pos = 0;
    if (s[i] == '(') q.push_front(i);
    if (s[i] == ')') {
      pos = q.front();
      q.pop_front();
      p[i] = pos;
      p[pos] = i;
    }
  }
  for (int i = 0; i < t.size(); i++) {
    if (t[i] == 'R') {
      uk = r[uk];
    }
    if (t[i] == 'L') {
      uk = l[uk];
    }
    if (t[i] == 'D') {
      if (s[uk] == '(') {
        int L = l[uk];
        r[L] = r[p[uk]];
        l[r[L]] = l[uk];
        if (r[p[uk]] == -1) {
          uk = l[uk];
        } else {
          uk = r[p[uk]];
        }
      } else {
        int R = r[uk];
        l[R] = l[p[uk]];
        r[l[R]] = r[uk];
        if (r[uk] == -1) {
          uk = l[p[uk]];
        } else {
          uk = r[uk];
        }
      }
    }
  }
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (l[i] == -1) {
      j = i;
    }
  }
  while (r[j] != -1) {
    cout << s[j];
    j = r[j];
  }
  cout << s[j];
  return 0;
}
