generate all possible pairs of brackets