#include <bits/stdc++.h>
using namespace std;
int g[200][200];
int main() {
  int n, k;
  cin >> k;
  n = 0;
  for (int i = 100; i >= 3; i--) {
    if (i * (i - 1) * (i - 2) / 6 <= k) {
      for (int j = n; j < n + i; j++)
        for (int t = n; t < n + i; t++)
          if (j != t) g[j][t] = 1;
      n += i;
      k -= i * (i - 1) * (i - 2) / 6;
      if (k == 0) break;
      n++;
      for (int j = 0; j < n - 1; j++) {
        if (k >= j) {
          g[n - i + j - 1][n - 1] = g[n - 1][n - i + j - 1] = 1;
          k -= j;
        } else
          break;
      }
      if (k == 1) {
        g[n][n - i - 1] = g[n - i - 1][n] = 1;
        g[n][n - i] = g[n - i][n] = 1;
        n++;
        k--;
      }
      i++;
    }
  }
  printf("%d\n", n);
  for (int i = 0; i < n; i++, printf("\n"))
    for (int j = 0; j < n; j++) printf("%d", g[i][j]);
  return 0;
}
