#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void read(Tp &x) {
  static char c;
  static bool neg;
  x = 0, c = getchar(), neg = false;
  for (; !isdigit(c); c = getchar()) {
    if (c == '-') {
      neg = true;
    }
  }
  for (; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  if (neg) {
    x = -x;
  }
}
const int N = 100 + 5;
int k, n, t;
inline int C(int n, int m) {
  if (m == 2) {
    return n * (n - 1) / 2;
  } else if (m == 3) {
    return n * (n - 1) * (n - 2) / 6;
  } else {
    return -1;
  }
}
int G[N][N];
int main() {
  read(k);
  for (; C(n, 3) <= k; ++n)
    ;
  --n;
  k -= C(n, 3);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      G[i][j] = G[j][i] = 1;
    }
  }
  while (k > 0) {
    ++n;
    for (t = 0; C(t, 2) <= k; ++t)
      ;
    --t;
    for (int i = 1; i <= t; ++i) {
      G[i][n] = G[n][i] = 1;
    }
    k -= C(t, 2);
  }
  printf("%d\n", n);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      putchar('0' + G[i][j]);
    }
    puts("");
  }
}
