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