#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, -1, 0, 1};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  vector<vector<long long>> vis(101, vector<long long>(101, 0));
  long long k;
  cin >> k;
  if (k == 1) {
    cout << 3 << "\n";
    cout << "011\n101\n110\n";
    return 0;
  }
  long long num = 0;
  while (num * (num - 1) * (num - 2) / 6 <= k) {
    num++;
  }
  num--;
  k -= (num * (num - 1) * (num - 2)) / 6;
  long long ans = num;
  for (long long i = 1; i <= num; i++) {
    for (long long j = i + 1; j <= num; j++) vis[i][j] = vis[j][i] = 1;
  }
  while (k) {
    ans++;
    num = 2;
    while (num * (num - 1) / 2 <= k) num++;
    num--;
    k -= num * (num - 1) / 2;
    for (long long i = 1; i <= num; i++) {
      vis[i][ans] = vis[ans][i] = 1;
    }
  }
  cout << ans << "\n";
  for (long long i = 1; i <= ans; i++) {
    for (long long j = 1; j <= ans; j++) {
      cout << vis[i][j];
    }
    cout << "\n";
  }
}
