#include <bits/stdc++.h>
using namespace std;
int st, j, k, n, s, K;
int f[155][155];
int main() {
  scanf("%d", &K);
  st = 0;
  for (int i = 3; i <= 100; i++)
    if (i * (i - 1) * (i - 2) / 6 > K) {
      n = i;
      break;
    }
  n--;
  s = 0;
  for (int i = 1; i <= n - 2; i++)
    for (int j = i + 1; j <= n - 1; j++)
      for (int k = j + 1; k <= n; k++) {
        f[i][j] = f[j][i] = f[j][k] = f[k][j] = f[i][k] = f[k][i] = 1;
        s++;
      }
  K = K - s;
  st = n;
  while (K) {
    int tem = 0;
    for (int i = 1; i <= n; i++) {
      if (tem + i - 1 <= K) {
        tem += i - 1;
        f[st + 1][i] = f[i][st + 1] = 1;
      }
    }
    K -= tem;
    st = st + 1;
  }
  printf("%d\n", st);
  for (int i = 1; i <= st; i++) {
    for (int j = 1; j <= st; j++) printf("%d", f[i][j]);
    puts("");
  }
  return 0;
}
