#include <bits/stdc++.h>
using namespace std;
const int OO = (int)2e9;
const double EPS = 1e-9;
int dcmp(double a, double b) { return fabs(a - b) <= EPS ? 0 : a > b ? 1 : -1; }
int DI[] = {-1, 0, 1, 0, 1, -1, -1, 1};
int DJ[] = {0, 1, 0, -1, 1, -1, 1, -1};
int g[101][101];
int clc(int k, int lst) {
  for (int i = lst - 1; i >= 0; i--) {
    int cycles = (i * (i + 1)) / 2;
    if (k < cycles) continue;
    return i;
  }
  return 0;
}
int main() {
  int k, n = 3, lst = 3;
  {
    g[0][1] = g[1][0] = 1;
    g[1][2] = g[2][1] = 1;
    g[2][0] = g[0][2] = 1;
  }
  scanf("%d", &k);
  k--;
  while (k > 0) {
    int idx = clc(k, lst);
    int cycles = (idx * (idx + 1)) / 2;
    for (int j = 0; j <= idx; j++) g[j][n] = g[n][j] = 1;
    k -= cycles;
    n++;
    if (idx + 1 == lst) lst++;
  }
  printf("%d\n", n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%d", g[i][j]);
    printf("\n");
  }
  return 0;
}
