#include using namespace std; vector ret(int n) { if(n == 1) { vector ans = {"0", "1"}; return ans; } vector ans; vector a = ret(n - 1); vector b = a; reverse(b.begin(), b.end()); for(auto temp : a) { string t = "0"; t += temp; ans.push_back(t); } for(auto temp : b) { string t = "1"; t += temp; ans.push_back(t); } return ans; } int main() { int n; cin >> n; vector sol = ret(n); for(auto temp : sol) { cout << temp << "\n"; } }