#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 100;
pair<long long, long long> a[maxn];
vector<int> v;
long long jof[maxn];
long long n, m, p;
string s, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> p;
  cin >> k;
  a[0] = pair<long long, long long>(-1, 1);
  for (long long y = 1; y <= n; y++) {
    a[y] = pair<long long, long long>(y - 1, y + 1);
    if (k[y - 1] == '(')
      v.push_back(y);
    else {
      jof[y] = v.back();
      jof[v.back()] = y;
      v.pop_back();
    }
  }
  cin >> s;
  for (long long y = 0; y < s.size(); y++) {
    if (s[y] == 'L') p = a[p].first;
    if (s[y] == 'R') p = a[p].second;
    if (s[y] == 'D') {
      long long i = p;
      long long j = jof[p];
      if (i > j) swap(i, j);
      i = a[i].first;
      j = a[j].second;
      a[i].second = j;
      a[j].first = i;
      if (j != n + 1)
        p = j;
      else
        p = i;
    }
  }
  p = a[0].second;
  while (p < n + 1) {
    cout << k[p - 1];
    p = a[p].second;
  }
}
