for(;r=readline();print(a+b||"()"))for(a=b="";+r;a+="(",b=y?"())"+b:")"+b)y=0,r=r.replace(/./g,function(x)y+x>>(y=x%2,1))
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page