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))