Олимпиадный тренинг

Задача 31804. Brackets-2


Задача

Темы: Рекурсия
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
(())
[[]]
[()]
()[]
[]()
()()
([])
[][]