#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, t, i, j, need, vertex;
  int nc3[101];
  int graph[101][101];
  fill_n(nc3, 101, 1);
  for (i = 4; i < 101; i++) {
    for (j = i; j > i - 3; j--) nc3[i] *= j;
    nc3[i] = nc3[i] / 6;
  }
  cin >> k;
  i = 3;
  while (k >= nc3[i]) i++;
  i--;
  vertex = i;
  need = k - nc3[i];
  for (i = 1; i <= vertex; i++) {
    for (j = 1; j <= vertex; j++) {
      if (i == j)
        graph[i][i] = 0;
      else
        graph[i][j] = graph[j][i] = 1;
    }
  }
  while (need) {
    vertex++;
    graph[vertex][1] = graph[1][vertex] = 1;
    for (i = 2; i < vertex && need >= i - 1; i++) {
      need -= i - 1;
      graph[vertex][i] = graph[i][vertex] = 1;
    }
  }
  printf("%d\n", vertex);
  for (i = 1; i <= vertex; i++) {
    for (j = 1; j <= vertex; j++) printf("%d", graph[i][j]);
    printf("\n");
  }
}
