while 1: t='' for c in bin(input())[2:]:t='('+t+'()'*int(c)+')' print t