#a229 TLE
def DFS(left, right, road):
if left != 0 or right!= 0:
if left > right:
return
if left + right == 4:
if left == 0:
print("".join(road) + "))))")
return
if left == 1:
print("".join(road) + "()))")
print("".join(road) + ")())")
print("".join(road) + "))()")
return
if left == 2:
print("".join(road) + "(())")
print("".join(road) + "()()")
return
if left> 0:
road.append("(")
DFS(left-1, right , road)
road.pop()
if right>0:
road.append(")")
DFS(left, right-1 , road)
road.pop()
return
else:
print("".join(road))
return
for line in __import__("sys").stdin:
road = ["("]
DFS(int(line)-1 , int(line) , road)
print(" ")