from sys import stdin
def generateParentheses(n):
result = []
def backtrack(s='', left=0, right=0):
if len(s) == n * 2:
result.append(s)
return
if left < n:
backtrack(s + '(', left + 1, right)
if right < left:
backtrack(s + ')', left, right + 1)
backtrack()
return result
input_str = stdin.read().strip()
numbers = list(map(int, input_str.split()))
for n in numbers:
combinations = generateParentheses(n)
for combination in combinations:
print(combination)