#include #include using namespace std; int main() { int N; cin >> N; int step = 1; int solution [1 << 14]; int size = 2; solution [1] = 0; solution [2] = 1; while (step < N) { for (int index = size + 1; index <= 2 * size ; ++ index) { solution [index] = (1 << step) + solution [2 * size - index + 1]; } size <<= 1; step += 1; } assert(size == (1 << N)); for (int index = 1; index <= size ; ++ index) { for (int bit = N - 1; bit >= 0; -- bit) { if (solution [index] & (1 << bit)) { cout << 1; } else { cout << 0; } } cout << '\n'; } return 0; }