#include <bits/stdc++.h>
using namespace std;
bool adj[100][100];
int nc3(int n) { return n * (n - 1) * (n - 2) / 6; }
int nc2(int n) { return n * (n - 1) / 2; }
int main() {
  int k;
  scanf("%d", &k);
  int n = 1;
  while (nc3(n) <= k) n++;
  n--;
  k -= nc3(n);
  for (__typeof(n) i = 1; i <= (n); i++)
    for (__typeof(n) j = 1; j <= (n); j++)
      if (i != j) adj[i][j] = true;
  while (k > 0) {
    int m = 1;
    while (nc2(m) <= k) m++;
    m--;
    n++;
    for (__typeof(m) i = 1; i <= (m); i++) adj[i][n] = adj[n][i] = true;
    k -= nc2(m);
  }
  printf("%d\n", n);
  for (__typeof(n) i = 1; i <= (n); i++) {
    for (__typeof(n) j = 1; j <= (n); j++) {
      printf("%d", adj[i][j]);
    }
    printf("\n");
  }
  return 0;
}
