#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
int k;
int G[MAXN][MAXN];
int C[MAXN][5];
void getC() {
  C[0][0] = C[1][0] = C[1][1] = C[2][2] = C[2][0] = 1;
  C[2][1] = 2;
  for (int ii = 3; ii <= 100; ii++) {
    C[ii][0] = 1;
    for (int jj = 1; jj <= 3; jj++) {
      C[ii][jj] = C[ii - 1][jj] + C[ii - 1][jj - 1];
    }
  }
}
int main() {
  getC();
  scanf("%d", &k);
  int complete = 0;
  for (int t = 3; t <= 100; t++) {
    if (C[t][3] <= k)
      complete = t;
    else
      break;
  }
  int resdual = k - C[complete][3];
  for (int ii = 1; ii <= complete; ii++) {
    for (int jj = ii + 1; jj <= complete; jj++) {
      G[ii][jj] = G[jj][ii] = 1;
    }
  }
  while (resdual) {
    int ii;
    for (ii = 2; resdual >= C[ii + 1][2]; ii++)
      ;
    resdual -= C[ii][2];
    complete++;
    for (int jj = 1; jj <= ii; jj++) {
      G[complete][jj] = G[jj][complete] = 1;
    }
  }
  printf("%d\n", complete);
  for (int ii = 1; ii <= complete; ii++) {
    for (int jj = 1; jj <= complete; jj++) {
      printf("%d", G[ii][jj]);
    }
    printf("\n");
  }
}
