#include <bits/stdc++.h>

using namespace std;

int sum[100];

int main()
{
	freopen("free.in", "r", stdin);
	freopen("free.out", "w", stdout);
	int n;
	while (scanf("%d", &n) != EOF) {
		queue<string> Q;
		Q.push("0");
		Q.push("1");
		vector<string> ans;
		while (!Q.empty()) {
			string S = Q.front();
			Q.pop();
			if (S.length() == n) {
				ans.push_back(S);
				continue;
			}
			for (int k = 0; k < 2; k++) {
				string now = S + char('0' + k);
				for (int i = 0; i <= now.length(); i++) sum[i] = 0;
				for (int i = 1; i <= now.length(); i++) {
					int flag = 1;
					for (int k = 1; i + k + k - 1 <= now.length(); k++) {
						if (now.substr(i - 1, k) == now.substr(i - 1 + k, k)) {
							flag = 0;
							break;
						}
					}
					if (flag) {
						for (int j = i; j <= now.length(); j++) sum[j]++;
					}
				}
				int check = 1;
				for (int i = 1; i <= now.length(); i++) check &= 2 * sum[i] >= i;
				if (check) {
					Q.push(now);
				}
			}
		}
		cout << ans.size() << endl;
		sort(ans.begin(), ans.end());
		for (int i = 0; i < ans.size(); i++) cout << ans[i] << endl;
	}
	return 0;
}
