#include <bits/stdc++.h>
using namespace std;
int n, m, p;
set<int> ss;
int idx[500500];
char str[500500], op[500500];
int main() {
  cin >> n >> m >> p;
  scanf("%s%s", str + 1, op + 1);
  stack<int> s;
  ss.insert(0);
  for (int i = 1; i <= n; i++) {
    ss.insert(i);
    if (str[i] == '(')
      s.push(i);
    else
      idx[s.top()] = i, idx[i] = s.top(), s.pop();
  }
  for (int i = 1; i <= m; i++) {
    if (op[i] == 'R')
      p = *ss.upper_bound(p);
    else if (op[i] == 'L')
      p = *prev(ss.lower_bound(p));
    else {
      auto it = ss.lower_bound(p);
      int from = *it;
      int to = idx[from];
      int val;
      do {
        val = *it;
        auto nxt = it;
        if (from < to)
          nxt++;
        else
          nxt--;
        ss.erase(it);
        it = nxt;
      } while (val != to);
      if (from > to) it++;
      if (it == ss.end()) it--;
      p = *it;
    }
  }
  for (auto it : ss)
    if (it) printf("%c", str[it]);
  puts("");
  return 0;
}
