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