#include <bits/stdc++.h>
using namespace std;
const int NMax = 202;
const int INF = int(1e9);
const int cntTree = 262145;
const double eps = 1e-9;
const double PI = 3.141592653589793238462;
const int MOD = int(1e9);
int n, m;
int ans[101][101];
void solve(int n) {
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= 3; j++)
      if (i == j)
        ans[i][j] = 0;
      else
        ans[i][j] = 1;
  m = 3;
  n--;
  int v = 1, k = 0, u = 4;
  while (n > 0) {
    if (n - k < 0 || v > m) {
      m++;
      u++;
      k = 0;
      v = 1;
      continue;
    }
    n -= k;
    if (n == 0) m = u;
    ans[u][v] = 1;
    ans[v][u] = 1;
    v++;
    k++;
  }
}
int main() {
  scanf("%i", &n);
  memset(ans, 0, sizeof(ans));
  solve(n);
  printf("%i\n", m);
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) printf("%i", ans[i][j]);
    printf("\n");
  }
  return 0;
}
