Gray

Consider all possible N-bit binary configurations. Your task is to find a permutation of these values such that any two consecutive configurations differ by exactly one bit. If there are multiple solutions, all of them are considered correct.

Input

A single integer: N

Output

The output should contain all 2N configurations, each on a separate line.
Each configuration should consist of exactly N bits, including leading zeros.

Constraints

  • 1 ≤ N ≤ 12

Sample

InputOutput
3000
001
011
010
110
100
101
111
Questions?

Sponsors Gold