#include <bits/stdc++.h>
using namespace std;
bool a[105][105];
inline int c3(int t) { return t * (t - 1) * (t - 2) / 6; }
int c(int k) {
  int i;
  for (i = 1; i <= 104; i++)
    if (c3(i) > k) break;
  return i - 1;
}
int cc(int k) {
  int i;
  for (i = 1; i <= 104; i++)
    if (i * (i - 1) / 2 > k) break;
  return i - 1;
}
int main() {
  int i, j, k, n, t, k1;
  while (~scanf("%d", &k)) {
    for (i = 1; i <= 100; i++)
      for (j = 1; j <= 100; j++) a[i][j] = 0;
    n = 0;
    t = c(k);
    for (i = n + 1; i <= n + t; i++)
      for (j = n + 1; j <= n + t; j++)
        if (i - j) a[i][j] = a[j][i] = 1;
    n += t;
    k -= c3(t);
    while (k) {
      t = cc(k);
      for (i = 1; i <= t; i++) a[n + 1][i] = a[i][n + 1] = 1;
      n += 1;
      k -= t * (t - 1) / 2;
    }
    printf("%d\n", n);
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) printf("%d", a[i][j]);
      printf("\n");
    }
  }
  return 0;
}
