#include <bits/stdc++.h>
int cycle[101];
int ans[101][101];
int main() {
  for (int i = 3; i <= 100; i++) {
    cycle[i] = i * (i - 1) * (i - 2) / 6;
  }
  int k;
  scanf("%d", &k);
  int base = 0;
  for (int i = 3; i <= 100; i++) {
    if (cycle[i] <= k) base = i;
  }
  for (int i = 0; i < base; i++) {
    for (int j = 0; j < base; j++) ans[i][j] = 1;
    ans[i][i] = 0;
  }
  k -= cycle[base];
  int vertex = base;
  while (k) {
    for (int i = 0; i <= vertex; i++) {
      ans[i][vertex] = ans[vertex][i] = 0;
    }
    vertex++;
    int add = vertex - 1;
    int value = 1;
    ans[add][0] = 1;
    ans[0][add] = 1;
    int nxt = 1;
    while (k >= value) {
      k -= value;
      ans[add][nxt] = ans[nxt][add] = 1;
      nxt++;
      value++;
    }
  }
  printf("%d\n", vertex);
  for (int i = 0; i < vertex; i++) {
    for (int j = 0; j < vertex; j++) {
      printf("%d", ans[i][j]);
    }
    printf("\n");
  }
}
