Module: Correct Bracket Sequence (RSP)


Problem

6 /6


Brackets-2

Problem

Print all valid bracket expressions of length N, consisting of parentheses and square brackets.
 
Input
The first line contains a single number N. \(1 <= N <= 14\), N is even.
 
Output
Each expression is displayed on a separate line.
 

 

Examples
# Input Output
1 2
()
[]
2 4
(())
[[]]
[()]
()[]
[]()
()()
([])
[][]