m@main=readLn>>=putStrLn.f>>m f x='(':([div x 2|x>1]++[0|odd x]>>=f)++")"