#c22203. 字典序枚举

字典序枚举

Lexicographic Enumeration of Bit Strings

Problem Description

Given an integer nn, you need to output, in a certain order, all nn-bit strings made of characters 0 and 1.

The kk-th line contains all strings with exactly k−1k-1 ones. The strings on each line are sorted in lexicographic order and separated by a single space. See the sample for details.

Input Format

One line with an integer nn.

Output Format

Output nn lines, each containing several strings separated by spaces.

Sample Input

3

Sample Output

000
001 010 100
011 101 110
111

Constraints

For all data: 2≤n≤182 \leq n \leq 18.