#include <bits/stdc++.h>
int n, k, nodes;
int A[151][151];
int main() {
  scanf("%d", &k);
  nodes = 3;
  A[1][2] = A[2][1] = 1;
  A[1][3] = A[3][1] = 1;
  A[2][3] = A[3][2] = 1;
  k--;
  while (k) {
    nodes++;
    A[nodes][1] = A[1][nodes] = 1;
    for (int i = 2; i < nodes && k; i++) {
      int crt = 0;
      for (int j = 1; j < i; j++)
        if (A[i][j]) crt++;
      if (crt <= k) {
        k -= crt;
        A[nodes][i] = A[i][nodes] = 1;
      }
    }
  }
  printf("%d\n", nodes);
  for (int i = 1; i <= nodes; ++i) {
    for (int k = 1; k <= nodes; ++k) printf("%d", A[i][k]);
    printf("\n");
  }
  printf("\n");
  return (0);
}
