#include <bits/stdc++.h>
using namespace std;
int getInt() {
  int x;
  scanf("%d", &x);
  return x;
}
long long getLongLong() {
  long long x;
  scanf("%I64d", &x);
  return x;
}
double getDouble() {
  double x;
  scanf("%lf", &x);
  return x;
}
char getChar() {
  char x;
  scanf("%c", &x);
  return x;
}
template <typename t>
t abs(t a) {
  if (a >= 0) return a;
  return -a;
}
struct dual {
  int a, b;
  bool const operator<(const dual &x) const {
    if (a == x.a) return b > x.b;
    return a < x.a;
  }
};
struct triple {
  int a, b, c;
  bool const operator<(const triple &x) const {
    if (c == x.c) {
      if (a == x.a) return b > x.b;
      return a < x.a;
    }
    return c < x.c;
  }
};
vector<string> split(const string &s, char c) {
  vector<string> v;
  stringstream second(s);
  string x;
  while (getline(second, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << "  ";
  err(++it, args...);
}
void FastIO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
}
char s[512345];
char cmd[512345];
int p[512345];
stack<pair<char, int> > br;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  scanf("%s", s);
  for (int i = 0; s[i]; i++) {
    if (s[i] == '(')
      br.push({'(', i});
    else {
      auto v = br.top();
      br.pop();
      p[v.second] = i;
      p[i] = v.second;
    }
  }
  set<int> id;
  for (int i = 0; i < n; i++) id.insert(i);
  scanf("%s", cmd);
  int pos = k - 1;
  for (int i = 0; cmd[i]; i++) {
    if (cmd[i] == 'L') {
      auto it = id.find(pos);
      pos = *(--it);
    } else if (cmd[i] == 'R') {
      auto it = id.find(pos);
      pos = *(++it);
    } else {
      auto v = (*id.find(pos));
      vector<int> del;
      int lst = p[v];
      auto nxt = id.find(p[v]);
      if (s[v] == '(') {
        for (auto it = id.find(pos); (*it) != p[v]; it++) del.push_back(*it);
      } else
        for (auto it = id.find(pos); (*it) != p[v]; it--) del.push_back(*it);
      for (auto u : del) id.erase(u);
      nxt++;
      id.erase(lst);
      if (nxt == id.end()) nxt = (--id.end());
      pos = *nxt;
    }
  }
  for (auto x : id) printf("%c", s[x]);
  puts("");
  return 0;
}
