Yuhao and a Parenthesis

CodeForces - 1097C