#include <bits/stdc++.h>
using namespace std;
int k, n, matrix[200][200];
int main() {
  scanf("%d", &k);
  int q = 3;
  bool f = true;
  while (k) {
    q = 3;
    if (f) {
      while (q * (q - 1) * (q - 2) / 6 <= k) ++q;
      --q;
    } else {
      while (q * (q - 1) * (q - 2) / 6 -
                 max(0, (q - 1) * (q - 2) * (q - 3) / 6) <=
             k)
        ++q;
      --q;
    };
    if (f)
      k -= q * (q - 1) * (q - 2) / 6;
    else
      k -= q * (q - 1) * (q - 2) / 6 - max(0, (q - 1) * (q - 2) * (q - 3) / 6);
    if (f) {
      f = false;
      n = q;
      for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
          if (i != j) matrix[i][j] = 1;
    } else {
      ++n;
      for (int i = 1; i < q; i++) matrix[i][n] = matrix[n][i] = 1;
    };
  };
  printf("%d\n", n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%d", matrix[i][j]);
    printf("\n");
  };
  return 0;
}
