#include<bits/stdc++.h>
using namespace std;
class ParenthesesDiv1Easy
{
public :
vector < int > correct( string s) ;
} ;
vector < int > ParenthesesDiv1Easy:: correct ( string S)
{
vector < int > stk;
static vector < int > ret;
int i ;
for ( i= 0 ; i< S.length ( ) ; ++ i)
{
if ( S[ i] == '(' )
stk.push_back ( i) ;
else
{
if ( stk.empty ( ) || S[ * stk.rbegin ( ) ] ! = '(' )
stk.push_back ( i) ;
else
stk.pop_back ( ) ;
}
}
if ( stk.size ( ) % 2 )
{
ret.push_back ( - 1 ) ;
return ret;
}
i = 0 ;
while ( i< ( int ) stk.size ( ) && S[ stk[ i] ] == ')' )
++ i;
-- i;
i = min( ( int ) stk.size ( ) / 2 - 1 ,i) ;
if ( i! = - 1 )
{
ret.push_back ( stk[ 0 ] ) ;
ret.push_back ( stk[ i] ) ;
}
i = ( int ) stk.size ( ) - 1 ;
while ( i>= 0 && S[ stk[ i] ] == '(' )
-- i;
++ i;
i = max( ( int ) stk.size ( ) / 2 ,i) ;
if ( i! = stk.size ( ) )
{
ret.push_back ( stk[ i] ) ;
ret.push_back ( * stk.rbegin ( ) ) ;
}
return ret;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKY2xhc3MgUGFyZW50aGVzZXNEaXYxRWFzeQp7CglwdWJsaWM6Cgl2ZWN0b3IgPGludD4gY29ycmVjdChzdHJpbmcgcyk7Cgp9Owp2ZWN0b3IgPCBpbnQgPiBQYXJlbnRoZXNlc0RpdjFFYXN5Ojpjb3JyZWN0KHN0cmluZyBTKQp7Cgl2ZWN0b3IgPCBpbnQgPiBzdGs7CglzdGF0aWMgdmVjdG9yIDwgaW50ID4gcmV0OwoJaW50IGkgOwoJCglmb3IoaT0wO2k8Uy5sZW5ndGgoKTsrK2kpCgl7CgkJaWYoU1tpXT09JygnKQoJCQlzdGsucHVzaF9iYWNrKGkpOwoJCWVsc2UgCgkJewoJCQlpZihzdGsuZW1wdHkoKSAg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