#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= c == '-';
  for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
  x = f ? -x : x;
}
template <class T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  T y = 1;
  int len = 1;
  for (; y <= x / 10; y *= 10) ++len;
  for (; len; --len, x %= y, y /= 10) putchar(x / y + 48);
}
const int MAXN = 100;
int n = 1, m, e[MAXN + 5][MAXN + 5];
inline int C(int n, int m) {
  if (m == 2) return n * (n - 1) / 2;
  if (m == 3) return n * (n - 1) * (n - 2) / 6;
  return -1;
}
int main() {
  read(m);
  for (; C(n, 3) <= m; ++n)
    ;
  --n;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j < i; ++j) e[i][j] = e[j][i] = 1;
  m -= C(n, 3);
  for (int i = n - 1; i > 1; --i)
    for (; m >= C(i, 2); m -= C(i, 2)) {
      ++n;
      for (int j = 1; j <= i; ++j) e[j][n] = e[n][j] = 1;
    }
  write(n);
  putchar('\n');
  for (int i = 1; i <= n; ++i, putchar('\n'))
    for (int j = 1; j <= n; ++j) write(e[i][j]);
  return 0;
}
