#include <bits/stdc++.h>
using namespace std;
const long long int M = 5e5 + 5, LG = 17, inf = 1e18;
long long int n, p, q;
long long int a[M];
long long int l[M];
long long int r[M];
void del(long long int x) {
  l[r[x]] = l[x];
  r[l[x]] = r[x];
}
int main() {
  cin >> n >> q >> p;
  n += 2;
  for (int i = 0; i < n; i++) {
    l[i] = i - 1;
    r[i] = i + 1;
  }
  a[0] = 1;
  a[n - 1] = -1;
  for (int i = 1; i < n - 1; i++) {
    char c;
    cin >> c;
    a[i] = 2 * (c == '(') - 1;
  }
  string qq;
  cin >> qq;
  for (char c : qq) {
    if (c == 'R')
      p = r[p];
    else if (c == 'L')
      p = l[p];
    else {
      long long int cnt;
      if (a[p] == 1) {
        cnt = 1;
        del(p);
        p = r[p];
        while (cnt != 0) {
          cnt += a[p];
          del(p);
          p = r[p];
        }
      } else {
        cnt = -1;
        del(p);
        p = l[p];
        while (cnt != 0) {
          cnt += a[p];
          del(p);
          p = l[p];
        }
        p = r[p];
      }
    }
    if (p == 0) p = r[p];
    if (p == n - 1) p = l[p];
  }
  p = r[0];
  while (p != n - 1) {
    cout << (a[p] == 1 ? '(' : ')');
    p = r[p];
  }
}
