def gen(openb,closeb,n,s=[]):
if(closeb==n):
print("".join(s))
return
else:
if(openb>closeb):
s.append(’)’)
gen(openb,closeb+1,n,s)
s.pop()
if(openb<n):
s.append(’(’)
gen(openb+1,closeb,n,s)
return
while True:
try:
value = int(input())
gen(0,0,value) # next line was found
except (EOFError):
break #end of file reached