#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; void solve(int &n, vector<string> &sol){ if(!n){ sol.push_back(""); return; } n--; solve(n,sol); vector<string> aux = sol; reverse(aux.begin(), aux.end()); for(auto &x : sol) x = '0' + x; for(auto &x : aux) sol.push_back('1' + x); } int main(){ int n; vector<string> sol; cin >> n; solve(n, sol); for(auto &x : sol) cout << x << '\n'; }