#include <bits/stdc++.h>
const int inf = (int)1e9;
const int mod = 1e9 + 7;
using namespace std;
int d[2000011], d1[2000011];
string s, x;
int n, m, t;
void build(int v = 1, int tl = 1, int tr = n) {
  if (tl == tr) {
    d[v] = d1[v] = tl - 1;
    return;
  }
  int mid = (tl + tr) / 2;
  build(v * 2, tl, mid);
  build(v * 2 + 1, mid + 1, tr);
  d[v] = d[v * 2];
  d1[v] = max(d1[v * 2 + 1], d1[v * 2]);
}
int get(int type, int l, int r, int v = 1, int tl = 1, int tr = n) {
  if (tr < l || tl > r || tr < tl || r < l) {
    if (type == 1) return inf;
    return -inf;
  }
  if (tl >= l && tr <= r) {
    if (type == 1) return d[v];
    return d1[v];
  }
  int mid = (tl + tr) / 2;
  if (type == 1)
    return min(get(type, l, r, v * 2, tl, mid),
               get(type, l, r, v * 2 + 1, mid + 1, tr));
  else
    return max(get(type, l, r, v * 2, tl, mid),
               get(type, l, r, v * 2 + 1, mid + 1, tr));
}
void upd(int x, int v = 1, int tl = 1, int tr = n) {
  if (tl > x || tr < x) {
    return;
  }
  if (tl == tr) {
    d[v] = inf;
    d1[v] = -inf;
    return;
  }
  int mid = (tl + tr) / 2;
  upd(x, v * 2, tl, mid);
  upd(x, v * 2 + 1, mid + 1, tr);
  d[v] = min(d[v * 2], d[v * 2 + 1]);
  d1[v] = max(d1[v * 2], d1[v * 2 + 1]);
}
int check(int x, int v = 1, int tl = 1, int tr = n) {
  if (tl > x || tr < x) {
    return inf;
  }
  if (tl == tr) {
    return d1[v];
  }
  int mid = (tl + tr) / 2;
  return min(check(x, v * 2, tl, mid), check(x, v * 2 + 1, mid + 1, tr));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  cin >> t;
  t--;
  cin >> s >> x;
  build();
  for (int i = 0; i < m; i++) {
    if (x[i] == 'L') {
      t = get(2, 1, t);
    } else if (x[i] == 'R') {
      t = get(1, t + 2, n);
    } else {
      int a = 0, b = 0;
      upd(t + 1);
      if (s[t] == ')') {
        b++;
        for (int j = get(2, 1, t); j >= 0 && j < s.length(); j = get(2, 1, j)) {
          if (s[j] == ')') {
            b++;
          } else {
            a++;
          }
          upd(j + 1);
          if (a == b) {
            break;
          }
        }
      } else {
        a++;
        for (int j = get(1, t + 2, n); j < s.length(); j = get(1, j + 2, n)) {
          if (s[j] == ')') {
            b++;
          } else {
            a++;
          }
          upd(j + 1);
          if (a == b) {
            break;
          }
        }
      }
      if (get(1, t + 2, n) != inf) {
        t = get(1, t + 2, n);
      } else
        t = get(2, 1, t);
    }
  }
  for (int i = 0; i < n; i++) {
    if (check(i + 1) != -inf) cout << s[i];
  }
  return 0;
}
