#include #include #include #include #include #include #include #include #include #include #include #include #include #define loop(i,a,b) for(int i=a;i pii; typedef vector vi; typedef vector vvi; typedef vector vp; typedef vector vvp; typedef pair pip; typedef vectorvip; const double PI=acos(-1); const double EPS=1e-8; const int inf=1<<30; int main(){ int n,m; cin>>n>>m; string s; cin>>s; m--; bool h=false; if(s[m]==')'){ h=true; reverse(all(s)); m=n-1-m; rep(i,s.size())if(s[i]=='(')s[i]=')'; else s[i]='('; } int sum=-1; int t=0; rep(i,n){ if(i==m)sum=t; if(s[i]=='(')t++; else t--; if(sum==t){ i++; if(h)i=n-i+1; cout<