#include <iostream>
#include <list>
#define FOR(i,a,b) for(int i=a; i<b; i++)
#define dbug(x) #x<<": "<<x<<' '
using namespace std;
int n,m,p;
list<char> s;
list<char>::iterator it;
void del()
{
int os=0,cs=0;
if(*it == '(')
{
do
{
if(*it=='(')
os++;
else
cs++;
s.erase(it);
it++;
} while(os>cs);
}
else
{
do
{
if(*it=='(')
os++;
else
cs++;
s.erase(it);
it--;
} while(cs>os);
it++;
}
}
int main()
{
cin>>n>>m>>p;
FOR(i,0,n)
{
char tmp;
cin>>tmp;
s.push_back(tmp);
}
it=s.begin();
while(--p)
it++;
while(m--)
{
char tmp;cin>>tmp;
if(tmp == 'R')
it++;
else if(tmp == 'L')
it--;
else del();
}
for (it=s.begin(); it!=s.end(); ++it)
std::cout << *it;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGlzdD4KI2RlZmluZSBGT1IoaSxhLGIpIGZvcihpbnQgaT1hOyBpPGI7IGkrKykKI2RlZmluZSBkYnVnKHgpICN4PDwiOiAiPDx4PDwnICcKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG4sbSxwOwpsaXN0PGNoYXI+IHM7Cmxpc3Q8Y2hhcj46Oml0ZXJhdG9yIGl0Owp2b2lkIGRlbCgpCnsKCWludCBvcz0wLGNzPTA7CglpZigqaXQgPT0gJygnKQoJewoJCWRvCgkJewoJCQlpZigqaXQ9PScoJykKCQkJCW9zKys7CgkJCWVsc2UKCQkJCWNzKys7CgkJCXMuZXJhc2UoaXQpOwoJCQlpdCsrOwoJCX0gd2hpbGUob3M+Y3MpOwoJfQoJZWxzZQoJewoJCWRvCgkJewoJCQlpZigqaXQ9PScoJykKCQkJCW9zKys7CgkJCWVsc2UKCQkJCWNzKys7CgkJCXMuZXJhc2UoaXQpOwoJCQlpdC0tOwoJCX0gd2hpbGUoY3M+b3MpOwoJCWl0Kys7Cgl9Cn0KaW50IG1haW4oKQp7CgljaW4+Pm4+Pm0+PnA7CglGT1IoaSwwLG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