#include <bits/stdc++.h>
using namespace std;
const long long int infinity = 9e18;
struct DSU {
  int parent[500005], size[500005];
  void make_set(int v) {
    parent[v] = v;
    size[v] = 1;
  }
  int find_set(int v) {
    if (parent[v] == v) return v;
    return parent[v] = find_set(parent[v]);
  }
  void union_sets_right(int u, int v) {
    int a = find_set(u);
    int b = find_set(v);
    if (b > a) swap(a, b);
    parent[b] = a;
    size[a] += size[b];
  }
  void union_sets_left(int u, int v) {
    int a = find_set(u);
    int b = find_set(v);
    if (a > b) swap(a, b);
    parent[b] = a;
    size[a] += size[b];
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k, p;
  cin >> n >> k >> p;
  p--;
  string s, t;
  cin >> s >> t;
  stack<int> stk;
  DSU ds1, ds2;
  for (int i = 0; i < n; i++) {
    ds1.make_set(i);
    ds2.make_set(i);
  }
  vector<long long int> values(n, 0);
  for (long long int i = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      stk.push(i);
    } else {
      values[i] = stk.top();
      values[stk.top()] = i;
      stk.pop();
    }
  }
  for (long long int i = 0; i < t.size(); i++) {
    if (t[i] == 'R') {
      p = ds1.find_set(p);
      p++;
      if (ds1.size[ds1.find_set(p)] != 1) {
        p = ds1.find_set(p) + 1;
      }
    } else if (t[i] == 'L') {
      p = ds2.find_set(p);
      p--;
      if (ds2.size[ds2.find_set(p)] != 1) {
        p = ds2.find_set(p) - 1;
      }
    } else {
      ds1.union_sets_right(p, values[p]);
      ds2.union_sets_left(p, values[p]);
      long long int x = p;
      if (ds1.find_set(x) + 1 < n &&
          ds1.find_set(ds1.find_set(x) + 1) != ds1.find_set(x) + 1) {
        long long int y = ds1.find_set(x) + 1;
        ds1.union_sets_right(x, y);
        ds2.union_sets_left(x, y);
      }
      x = p;
      if (ds2.find_set(x) - 1 >= 0 &&
          ds2.find_set(ds2.find_set(x) - 1) != ds2.find_set(x) - 1) {
        long long int y = ds2.find_set(x) - 1;
        ds1.union_sets_right(x, y);
        ds2.union_sets_left(x, y);
      }
      if (ds1.find_set(p) + 1 < n) {
        p = ds1.find_set(p) + 1;
      } else {
        p = ds2.find_set(p) - 1;
      }
    }
  }
  int i = 0;
  while (i < n) {
    if (ds1.find_set(i) == i && ds1.size[ds1.find_set(i)] == 1) {
      if (values[i] > i) {
        cout << "(";
      } else {
        cout << ")";
      }
    }
    i = ds1.find_set(i) + 1;
  }
  return 0;
}
