#include <bits/stdc++.h>
using namespace std;
string tostr(int n) {
  stringstream rr;
  rr << n;
  return rr.str();
}
const int mod = 1e9 + 7;
const int mxn = 5e5 + 9;
const long double eps = 1e-9;
long long qpow(long long n, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = (ans * n) % mod;
    n = (n * n) % mod;
    k >>= 1;
  }
  return ans;
}
vector<int> v;
int pairpos[mxn], l[mxn], r[mxn];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int i, j, k, n, m, pos, q;
  string s;
  char ch;
  cin >> n >> q >> pos >> s;
  pos--;
  for (i = 0; i < n; i++) {
    if (s[i] == '(')
      v.push_back(i);
    else
      pairpos[i] = v.back(), pairpos[v.back()] = i, v.pop_back();
    l[i] = i - 1, r[i] = i + 1;
  }
  r[-1] = 0, l[n] = n - 1;
  while (q--) {
    cin >> ch;
    if (ch == 'L')
      pos = l[pos];
    else if (ch == 'R')
      pos = r[pos];
    else {
      if (s[pos] == '(')
        r[l[pos]] = r[pairpos[pos]], l[r[pairpos[pos]]] = l[pos],
        pos = r[pairpos[pos]];
      else
        l[r[pos]] = l[pairpos[pos]], r[l[pairpos[pos]]] = r[pos], pos = r[pos];
      if (pos == n) pos = l[pos];
    }
  }
  while (l[pos] != -1) pos = l[pos];
  while (pos != n) cout << s[pos], pos = r[pos];
  return 0;
}
