#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
int g[100][100];
int main() {
  scanf("%d", &n);
  int a = 0;
  while ((a + 1) * a * (a - 1) / 6 <= n) a++;
  memset(g, 0, sizeof(g));
  for (int i = 0; i < a; i++)
    for (int j = 0; j < a; j++)
      if (i != j) g[i][j] = 1;
  n -= a * (a - 1) * (a - 2) / 6;
  m = a;
  while (n) {
    int b = 0;
    while (b < a && (b + 1) * b / 2 <= n) b++;
    n -= b * (b - 1) / 2;
    for (int i = 0; i < b; i++) g[i][m] = g[m][i] = 1;
    m++;
  }
  printf("%d\n", m);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++) printf("%d", g[i][j]);
    printf("\n");
  }
  return 0;
}
