#include #include using namespace std; #define ll long long #define ld long double #define pb push_back #define mp make_pair #define pii pair #define pll pair #define pdd pair #define all(x) (x).begin(), (x).end() #define fi first #define se second string toBin(int x, int n) { string s = ""; for (int i = 0; i < n; i++) { s += x % 2 + '0'; x /= 2; } reverse(all(s)); return s; } int main() { cin.sync_with_stdio(false); int n; cin >> n; vector v = {0}; for (int i = 0; i < n; i++) { for (int j = 0, k = v.size() - 1; j < (1 << i); j++, k--) { v.pb((1 << i) + v[k]); } } for (auto it : v) { cout << toBin(it, n) << '\n'; } return 0; }