#include <bits/stdc++.h>
using namespace std;
const int N = 3000010;
const int inf = 1e9 + 1;
int n, m, p, k, var1[N], var2[N], neigbour[N], a[N];
string s, w;
int main() {
  scanf("%d%d%d\n", &n, &m, &p);
  cin >> s;
  cin >> w;
  k = 0;
  p--;
  for (int i = 0; i < n; i++)
    if (s[i] == '(') {
      a[++k] = i;
    } else {
      neigbour[i] = a[k];
      neigbour[a[k]] = i;
      k--;
    }
  for (int i = 0; i < n; i++) var1[i] = i - 1;
  for (int i = 0; i < n; i++) var2[i] = i + 1;
  for (int i = 0; i < m; i++) {
    if (w[i] == 'R')
      p = var2[p];
    else if (w[i] == 'L')
      p = var1[p];
    else {
      int j = neigbour[p];
      int k = p;
      if (k > j) swap(k, j);
      int j1 = var1[k];
      int j2 = var2[j];
      if (j1 != -1) var2[j1] = j2;
      if (j2 != n) var1[j2] = j1;
      if (j2 != n)
        p = j2;
      else
        p = j1;
    }
  }
  while (var1[p] != -1) p = var1[p];
  while (p != n) {
    cout << s[p];
    p = var2[p];
  }
  return 0;
}
