#include <bits/stdc++.h>
using namespace std;
int a[1009][1009];
int main() {
  int n = 0, m;
  cin >> m;
  for (; n * (n - 1) * (n - 2) / 6 <= m; n++)
    ;
  n--;
  for (int j = 0; j < n; j++)
    for (int k = 0; k < n; k++)
      if (j != k) a[j][k] = 1;
  m -= n * (n - 1) * (n - 2) / 6;
  while (m) {
    int i = 2;
    for (; i * (i - 1) / 2 <= m; i++)
      ;
    i--;
    for (int j = 0; j < i; j++) a[n][j] = a[j][n] = 1;
    n++;
    m -= i * (i - 1) / 2;
  }
  printf("%d\n", n);
  for (int i = 0; i < n; i++, puts(""))
    for (int j = 0; j < n; j++) printf("%d", a[i][j]);
}
