#include <bits/stdc++.h>
using namespace std;
int x, y, n, m, p, i, t, c[500009], b[500009], nex[500009], pre[500009];
string a;
char ch;
int main() {
  cin >> n >> m >> p >> a;
  nex[0] = 1;
  pre[n + 1] = n;
  a = '1' + a;
  for (i = 1; i <= n; i++) {
    nex[i] = i + 1;
    pre[i] = i - 1;
    if (a[i] == '(') {
      t++;
      b[t] = i;
    } else {
      c[b[t]] = i;
      c[i] = b[t];
      t--;
    }
  }
  for (i = 1; i <= m; i++) {
    cin >> ch;
    if (ch == 'R') {
      p = nex[p];
      if (p > n) p = pre[p];
    }
    if (ch == 'L') {
      p = pre[p];
      if (p == 0) p = nex[p];
    }
    if (ch == 'D') {
      x = p;
      y = c[p];
      if (x > y) swap(x, y);
      x = pre[x];
      y = nex[y];
      nex[x] = y;
      pre[y] = x;
      p = y;
      if (p > n) p = pre[p];
    }
  }
  t = 0;
  while (nex[t] <= n) {
    t = nex[t];
    cout << a[t];
  }
}
