#include <bits/stdc++.h>
#pragma comment(linker, "/stack:100000000")
using namespace std;
const int N = 200;
char s[N][N];
int main() {
  int C;
  cin >> C;
  int n = 3;
  while (n * (n - 1) * (n - 2) / 6 <= C) ++n;
  int m = --n;
  C -= n * (n - 1) * (n - 2) / 6;
  vector<int> add;
  while (C > 0) {
    ++n;
    for (int i = 2; i <= m; i++) {
      if (i * (i - 1) / 2 > C) {
        --i;
        add.push_back(i);
        C -= i * (i - 1) / 2;
        break;
      }
    }
  }
  assert(n <= 100);
  memset(s, '0', sizeof(s));
  for (int(i) = 0; (i) < (m); (i)++)
    for (int(j) = 0; (j) < (i); (j)++) s[i][j] = s[j][i] = '1';
  for (int i = m; i < n; i++) {
    for (int(j) = 0; (j) < (add[i - m]); (j)++) {
      s[i][j] = s[j][i] = '1';
    }
  }
  printf("%d\n", n);
  for (int(i) = 0; (i) < (n); (i)++) {
    s[i][n] = 0;
    puts(s[i]);
  }
  return 0;
}
