#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:67108864")
using namespace std;
const long double pi = 3.1415926535897932384626433832795;
const long double eps = 0.000000001;
const int INF = 1E9;
const int MAXN = 100;
int i, j, n, k, dp[MAXN + 10], dp2[MAXN + 10];
int g[MAXN + 10][MAXN + 10];
int main() {
  cin >> k;
  for (int i = (int)(1); i < (int)(MAXN + 1); i++) {
    dp[i] = i * (i - 1) * (i - 2) / 6;
    dp2[i] = i * (i - 1) / 2;
  }
  i = 1;
  while (dp[i] <= k) i++;
  i--;
  n = i;
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(n); j++)
      if (i != j) g[i][j] = 1;
  k -= dp[n];
  while (k > 0) {
    j = 1;
    while (dp2[j] <= k) j++;
    j--;
    for (int i = 0; i < (int)(j); i++) g[n][i] = g[i][n] = 1;
    n++;
    k -= dp2[j];
  }
  printf("%d\n", n);
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(n); j++) cout << g[i][j];
    cout << '\n';
  }
  return 0;
}
