#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int power(long long int a, long long int n) {
  if (n == 0) return 1;
  long long int x = power(a, n / 2);
  x = (x * x) % 1000000007;
  if (n % 2 != 0) {
    x = x * a;
    x = x % 1000000007;
  }
  return x;
}
int n;
int a[500001], w[500001][2];
char s[500001];
int delete1(int pos) {
  int i, j;
  j = a[pos];
  if (j > pos) {
    w[pos][1] = j + 1;
    w[j][0] = pos - 1;
    i = j + 1;
    while (i < n && w[i][1] != -1) {
      i = w[i][1];
    }
    if (i != j + 1) w[j + 1][1] = i;
    if (i >= n) {
      j = pos - 1;
      while (w[j][0] != -1) {
        j = w[j][0];
      }
      if (j != pos - 1) w[pos - 1][0] = j;
      return j;
    } else
      return i;
  } else {
    w[pos][0] = j - 1;
    w[j][1] = pos + 1;
    i = pos + 1;
    while (i < n && w[i][1] != -1) {
      i = w[i][1];
    }
    if (i != pos + 1) w[pos + 1][1] = i;
    if (i == n) {
      j--;
      i = j;
      while (w[j][0] != -1) {
        j = a[j];
        j--;
      }
      if (i != j) w[i][0] = j;
      return j;
    } else
      return i;
  }
}
int main() {
  int i, j, t, k, m, p;
  string q;
  scanf("%d %d %d", &n, &m, &p);
  p--;
  scanf("%s", s);
  q = s;
  stack<int> st;
  for (i = 0; i < n; i++) {
    if (s[i] == '(')
      st.push(i);
    else {
      j = st.top();
      st.pop();
      a[j] = i;
      a[i] = j;
    }
  }
  char c;
  scanf("%c", &c);
  memset(w, -1, sizeof(w));
  while (m--) {
    scanf("%c", &c);
    if (c == 'R') {
      p++;
      j = p;
      while (w[p][1] != -1) {
        p = w[p][1];
      }
      if (j != p) w[j][1] = p;
    } else if (c == 'L') {
      p--;
      j = p;
      while (w[p][0] != -1) {
        p = w[p][0];
      }
      if (j != p) w[j][0] = p;
    } else {
      p = delete1(p);
    }
  }
  for (i = 0; i < n; i++) {
    if (w[i][1] != -1) {
      i = w[i][1] - 1;
    } else
      printf("%c", s[i]);
  }
  printf("\n");
  return 0;
}
