#include <bits/stdc++.h>
using namespace std;
const int max_n = 105;
int k;
int ne[max_n];
int res[max_n][max_n];
int main() {
  scanf("%d", &k);
  int n = 3;
  while (n * (n - 1) * (n - 2) / 6 <= k) n++;
  n--;
  for (int i = 0; i < n; i++) ne[i] = n - 1;
  k = k - n * (n - 1) * (n - 2) / 6;
  while (k > 0) {
    int c = 2;
    while (c < n and c * (c - 1) / 2 <= k) c++;
    c--;
    ne[n] = c;
    for (int i = 0; i < c; i++) ne[i]++;
    n++;
    k = k - c * (c - 1) / 2;
  }
  printf("%d\n", n);
  for (int i = 0; i < n; i++) {
    int k = ne[i];
    for (int j = 0; j < n; j++) {
      if (k > 0 and i != j) {
        printf("1");
        k--;
      } else
        printf("0");
    }
    printf("\n");
  }
  return 0;
}
