LearnPy Hub
← Arena
IntermediateRating 1300

All Balanced Brackets

Print every balanced string of n pairs of brackets, in alphabetical order (where ( comes before )), one per line.

Input

One integer n (1 ≤ n ≤ 8).

Output

The strings.

Sample 1

Input
1
Output
()

Sample 2

Input
2
Output
(())
()()
solution.py
Output appears here
All Balanced Brackets · Python Arena problem · LearnPy Hub