#include #include #include #include #include #define REP(i,k,n) for(int i=k;i> n >> k; string s; cin >> s; memset(cnt,0,sizeof(cnt)); rep(i,s.size()) { if(s[i] == '(') cnt[i]++; else cnt[i+1]--; } REP(i,1,s.size()+1) cnt[i] += cnt[i-1]; rep(i,s.size()) { if(k-1 == i) continue; if(cnt[k-1] == cnt[i]) cout << i+1 << endl; } return 0; }