Given $N$, print all $2^N$ strings of length $N$ made of O and X. Decide each position from the first to the last, always choosing O before X, so the output is in lexicographic order with O < X.
Input
One integer $N$ ($1 \le N \le 15$).
Output
Print all $2^N$ combinations, one per line.
Example 1
Input
3
Output
OOO OOX OXO OXX XOO XOX XXO XXX
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.