#include <bits/stdc++.h>
int main() {
  int q, k, n, link[100][100] = {0};
  scanf("%d", &k);
  for (n = 3; n <= 100; n++)
    if ((n + 1) * (n) * (n - 1) / 6 > k) {
      k -= (n) * (n - 1) * (n - 2) / 6;
      break;
    }
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) link[j][i] = link[i][j] = 1;
  while (k != 0) {
    for (q = 2; q <= n; q++)
      if ((q + 1) * (q) / 2 > k) {
        k -= (q) * (q - 1) / 2;
        break;
      }
    for (int i = 0; i < q; i++) link[n][i] = link[i][n] = 1;
    n++;
  }
  printf("%d\n", n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) printf("%d", link[i][j]);
    printf("\n");
  }
  return 0;
}
